HttpRequestHeaderCollection.TryAppendWithoutValidation(String, String) 方法

定義

嘗試將指定的專案附加至 HttpRequestHeaderCollection 而不進行驗證。

public:
 virtual bool TryAppendWithoutValidation(Platform::String ^ name, Platform::String ^ value) = TryAppendWithoutValidation;
bool TryAppendWithoutValidation(winrt::hstring const& name, winrt::hstring const& value);
public bool TryAppendWithoutValidation(string name, string value);
function tryAppendWithoutValidation(name, value)
Public Function TryAppendWithoutValidation (name As String, value As String) As Boolean

參數

name
String

Platform::String

winrt::hstring

要附加的專案名稱。

value
String

Platform::String

winrt::hstring

要附加的專案值。

傳回

Boolean

bool

如果附加專案,則為true;否則為 false

備註

當您需要在沒有 HTTP 標頭強型別類別的 HTTP 要求上使用 HTTP 標頭時,可以使用 TryAppendWithoutValidation 方法。 如果有 HTTP 標頭的強型別實作,則應該使用強型別類別上的方法和屬性,而不是 TryAppendWithoutValidation 方法。

適用於