C# Класс MvcApi.RequestContextExtensions

Extension methods that facilitate support for content negotiation and HTTP method overload. The results for GetHttpMethod() GetRequestFormat() and GetResponseFormats() are cached on the RouteData dictionary.
Показать файл Открыть проект

Открытые методы

Метод Описание
GetHttpMethod ( this requestContext ) : string

Returns the HTTP method of the request, honoring override via the "X-Http-Method-Override" HTTP header or a form variable with the same name.

GetRequestFormat ( this requestContext ) : ContentType

Returns the format of a given request.

GetResponseFormats ( this requestContext ) : List

Returns a collection of formats that should be used to render a response to a given request, sorted in priority order.

IsBrowserRequest ( this requestContext ) : bool

Determines whether the specified HTTP request was sent by a Browser.

QueryString ( this requestContext ) : NameValueCollection

Приватные методы

Метод Описание
GetAndCacheObject ( System.Web.Routing.RequestContext requestContext, string key, object>.Func getter ) : object

Описание методов

GetHttpMethod() публичный статический Метод

Returns the HTTP method of the request, honoring override via the "X-Http-Method-Override" HTTP header or a form variable with the same name.
public static GetHttpMethod ( this requestContext ) : string
requestContext this
Результат string

GetRequestFormat() публичный статический Метод

Returns the format of a given request.
If the format is unrecognized or not supported.
public static GetRequestFormat ( this requestContext ) : ContentType
requestContext this
Результат System.Net.Mime.ContentType

GetResponseFormats() публичный статический Метод

Returns a collection of formats that should be used to render a response to a given request, sorted in priority order.
public static GetResponseFormats ( this requestContext ) : List
requestContext this
Результат List

IsBrowserRequest() публичный статический Метод

Determines whether the specified HTTP request was sent by a Browser.
public static IsBrowserRequest ( this requestContext ) : bool
requestContext this
Результат bool

QueryString() публичный статический Метод

public static QueryString ( this requestContext ) : NameValueCollection
requestContext this
Результат System.Collections.Specialized.NameValueCollection