HttpRequestHeadersExtensions.GetCookies Method
Namespace: System.Net.Http
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Overload List
Name | Description | |
---|---|---|
GetCookies(HttpRequestHeaders) | Gets any cookie headers present in the request. |
|
GetCookies(HttpRequestHeaders, String) | Gets any cookie headers present in the request that contain a cookie state whose name that matches the specified value. |
See Also
HttpRequestHeadersExtensions Class
System.Net.Http Namespace
Return to top
HttpRequestHeadersExtensions.GetCookies Method (HttpRequestHeaders)
Gets any cookie headers present in the request.
Syntax
public static Collection<CookieHeaderValue> GetCookies(
this HttpRequestHeaders headers
)
public:
[ExtensionAttribute]
static Collection<CookieHeaderValue^>^ GetCookies(
HttpRequestHeaders^ headers
)
static member GetCookies :
headers:HttpRequestHeaders -> Collection<CookieHeaderValue>
<ExtensionAttribute>
Public Shared Function GetCookies (
headers As HttpRequestHeaders
) As Collection(Of CookieHeaderValue)
Parameters
headers
Type: System.Net.Http.Headers.HttpRequestHeadersThe request headers.
Return Value
Type: System.Collections.ObjectModel.Collection<CookieHeaderValue>
A collection of CookieHeaderValue instances.
Return to top
HttpRequestHeadersExtensions.GetCookies Method (HttpRequestHeaders, String)
Gets any cookie headers present in the request that contain a cookie state whose name that matches the specified value.
Syntax
public static Collection<CookieHeaderValue> GetCookies(
this HttpRequestHeaders headers,
string name
)
public:
[ExtensionAttribute]
static Collection<CookieHeaderValue^>^ GetCookies(
HttpRequestHeaders^ headers,
String^ name
)
static member GetCookies :
headers:HttpRequestHeaders *
name:string -> Collection<CookieHeaderValue>
<ExtensionAttribute>
Public Shared Function GetCookies (
headers As HttpRequestHeaders,
name As String
) As Collection(Of CookieHeaderValue)
Parameters
headers
Type: System.Net.Http.Headers.HttpRequestHeadersThe request headers.
name
Type: System.StringThe cookie state name to match.
Return Value
Type: System.Collections.ObjectModel.Collection<CookieHeaderValue>
A collection of CookieHeaderValue instances.
Return to top