Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

HttpClient.DefaultRequestHeaders Property

Definition

Namespace:
System.Net.Http
Assembly:
System.Net.Http.dll
Assemblies:
netstandard.dll, System.Net.Http.dll
Assembly:
netstandard.dll
Source:
HttpClient.cs
Source:
HttpClient.cs
Source:
HttpClient.cs
Source:
HttpClient.cs
Source:
HttpClient.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets the headers which should be sent with each request.

public:
 property System::Net::Http::Headers::HttpRequestHeaders ^ DefaultRequestHeaders { System::Net::Http::Headers::HttpRequestHeaders ^ get(); };
public System.Net.Http.Headers.HttpRequestHeaders DefaultRequestHeaders { get; }
member this.DefaultRequestHeaders : System.Net.Http.Headers.HttpRequestHeaders
Public ReadOnly Property DefaultRequestHeaders As HttpRequestHeaders

Property Value

The headers which should be sent with each request.

Remarks

Headers set on this property don't need to be set on request messages again. DefaultRequestHeaders should not be modified while there are outstanding requests.

Applies to


Feedback

Was this page helpful?