DefaultRequestHeaders Property
Collapse the table of content
Expand the table of content

HttpClient.DefaultRequestHeaders Property

.NET Framework (current version)
 

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.

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
Show:
© 2016 Microsoft