Show / Hide Table of Contents

Class HttpRequestMessageExtensions

Extends the HttpRequestMessage collection.

Inheritance
object
HttpRequestMessageExtensions
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Dnn.PersonaBar.Library
Assembly: Dnn.PersonaBar.Library.dll
Syntax
public static class HttpRequestMessageExtensions

Methods

GetCookie(HttpRequestMessage, string)

Retrieves an individual cookie from the cookies collection.

Declaration
public static string GetCookie(this HttpRequestMessage request, string cookieName)
Parameters
Type Name Description
HttpRequestMessage request
string cookieName
Returns
Type Description
string

The cookie value or null.

GetHeader(HttpRequestMessage, string)

Returns an individual HTTP Header value.

Declaration
public static string GetHeader(this HttpRequestMessage request, string key)
Parameters
Type Name Description
HttpRequestMessage request
string key
Returns
Type Description
string

The header value or null.

GetQueryString(HttpRequestMessage, string)

Returns an individual querystring value.

Declaration
public static string GetQueryString(this HttpRequestMessage request, string key)
Parameters
Type Name Description
HttpRequestMessage request
string key
Returns
Type Description
string

The query string value or null.

GetQueryStringAsInteger(HttpRequestMessage, string)

Returns an individual querystring value as integer.

Declaration
public static int GetQueryStringAsInteger(this HttpRequestMessage request, string key)
Parameters
Type Name Description
HttpRequestMessage request
string key
Returns
Type Description
int

The query string value or -1.

GetQueryStrings(HttpRequestMessage)

Returns a dictionary of QueryStrings that's easier to work with than GetQueryNameValuePairs KevValuePairs collection.

If you need to pull a few single values use GetQueryString instead.

Declaration
public static Dictionary<string, string> GetQueryStrings(this HttpRequestMessage request)
Parameters
Type Name Description
HttpRequestMessage request
Returns
Type Description
Dictionary<string, string>

A Dictionary<TKey, TValue> of query string keys to values.

Back to top by the community, for the community... #DNNCMS