HttpHeaders.TryAddWithoutValidation Method

Definition

Returns a value that indicates whether a new header and its values were added to the HttpHeaders collection without validating the provided information.

Overloads

TryAddWithoutValidation(String, IEnumerable<String>)

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)

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>)

Source:
HttpHeaders.cs
Source:
HttpHeaders.cs
Source:
HttpHeaders.cs

Returns a value that indicates whether the specified header and its values were added to the HttpHeaders collection without validating the provided information.

C#
public bool TryAddWithoutValidation(string name, System.Collections.Generic.IEnumerable<string> values);
C#
public bool TryAddWithoutValidation(string name, System.Collections.Generic.IEnumerable<string?> values);

Parameters

name
String

The header to add to the collection.

values
IEnumerable<String>

The values of the header.

Returns

true if the specified header name and values could be added to the collection; otherwise false.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

TryAddWithoutValidation(String, String)

Source:
HttpHeaders.cs
Source:
HttpHeaders.cs
Source:
HttpHeaders.cs

Returns a value that indicates whether the specified header and its value were added to the HttpHeaders collection without validating the provided information.

C#
public bool TryAddWithoutValidation(string name, string value);
C#
public bool TryAddWithoutValidation(string name, string? value);

Parameters

name
String

The header to add to the collection.

value
String

The content of the header.

Returns

true if the specified header name and value could be added to the collection; otherwise false.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0