Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DefaultRequestHeaders Property

HttpClient.DefaultRequestHeaders Property

.NET Framework 4.6 and 4.5

Gets the headers which should be sent with each request.

Namespace:  System.Net.Http
Assembly:  System.Net.Http (in System.Net.Http.dll)

public HttpRequestHeaders DefaultRequestHeaders { get; }

Property Value

Type: System.Net.Http.Headers.HttpRequestHeaders
Returns HttpRequestHeaders.
The headers which should be sent with each request.

Headers set on this property don't need to be set on request messages again.

.NET Framework

Supported in: 4.6, 4.5

.NET for Windows Phone apps

Supported in: Windows Phone 8.1
Show:
© 2015 Microsoft