HttpHeaders.TryAddWithoutValidation 方法

定义

返回一个值,该值指示是否已将新标头及其值添加到 HttpHeaders 集合而未验证所提供的信息。Returns a value that indicates whether a new header and its values were added to the HttpHeaders collection without validating the provided information.

重载

TryAddWithoutValidation(String, IEnumerable<String>)

返回一个值,该值指示指定的标头及其值是否添加到 HttpHeaders 集合,而无需验证提供的信息。Returns a value that indicates whether the specified header and its values were added to the HttpHeaders collection without validating the provided information.

TryAddWithoutValidation(String, String)

返回一个值,该值指示指定的标头及其值是否添加到了 HttpHeaders 集合,而无需验证提供的信息。Returns a value that indicates whether the specified header and its value were added to the HttpHeaders collection without validating the provided information.

TryAddWithoutValidation(String, IEnumerable<String>)

返回一个值,该值指示指定的标头及其值是否添加到 HttpHeaders 集合,而无需验证提供的信息。Returns a value that indicates whether the specified header and its values were added to the HttpHeaders collection without validating the provided information.

public:
 bool TryAddWithoutValidation(System::String ^ name, System::Collections::Generic::IEnumerable<System::String ^> ^ values);
public bool TryAddWithoutValidation (string name, System.Collections.Generic.IEnumerable<string> values);
public bool TryAddWithoutValidation (string name, System.Collections.Generic.IEnumerable<string?> values);
member this.TryAddWithoutValidation : string * seq<string> -> bool
Public Function TryAddWithoutValidation (name As String, values As IEnumerable(Of String)) As Boolean

参数

name
String

要添加到集合中的标头。The header to add to the collection.

values
IEnumerable<String>

标头的值。The values of the header.

返回

Boolean

如果指定的标头 namevalues 可能被添加到集合,则为 true;否则为 falsetrue if the specified header name and values could be added to the collection; otherwise false.

适用于

TryAddWithoutValidation(String, String)

返回一个值,该值指示指定的标头及其值是否添加到了 HttpHeaders 集合,而无需验证提供的信息。Returns a value that indicates whether the specified header and its value were added to the HttpHeaders collection without validating the provided information.

public:
 bool TryAddWithoutValidation(System::String ^ name, System::String ^ value);
public bool TryAddWithoutValidation (string name, string value);
public bool TryAddWithoutValidation (string name, string? value);
member this.TryAddWithoutValidation : string * string -> bool
Public Function TryAddWithoutValidation (name As String, value As String) As Boolean

参数

name
String

要添加到集合中的标头。The header to add to the collection.

value
String

标头的内容。The content of the header.

返回

Boolean

如果指定的标头 namevalue 可能被添加到集合,则为 true;否则为 falsetrue if the specified header name and value could be added to the collection; otherwise false.

适用于