Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

HttpResponseHeadersExtensions Class

 

Provides extension methods for the HttpResponseHeaders class.

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

System::Object
  System.Net.Http::HttpResponseHeadersExtensions

[EditorBrowsableAttribute(EditorBrowsableState::Never)]
[ExtensionAttribute]
public ref class HttpResponseHeadersExtensions abstract sealed 

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAddCookies(HttpResponseHeaders^, IEnumerable<CookieHeaderValue^>^)

Adds cookies to a response. Each Set-Cookie header is represented as one CookieHeaderValue instance. A CookieHeaderValue contains information about the domain, path, and other cookie information as well as one or more CookieState instances. Each CookieState instance contains a cookie name and whatever cookie state is associate with that name. The state is in the form of a NameValueCollection which on the wire is encoded as HTML Form URL-encoded data. This representation allows for multiple related "cookies" to be carried within the same Cookie header while still providing separation between each cookie state. A sample Cookie header is shown below. In this example, there are two CookieState with names state1 and state2 respectively. Further, each cookie state contains two name/value pairs (name1/value1 and name2/value2) and (name3/value3 and name4/value4). <code> Set-Cookie: state1:name1=value1&amp;name2=value2; state2:name3=value3&amp;name4=value4; domain=domain1; path=path1; </code>

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: