C# 클래스 MvcApi.HttpRequestBaseExtensions

Extension methods that facilitate support for content negotiation and HTTP method overload.
파일 보기 프로젝트 열기: dax70/MvcApi

공개 메소드들

메소드 설명
GetRequestFormat ( this request ) : ContentType

Returns the format of a given request.

GetResponseFormats ( this request ) : List

Returns the preferred content type to use for the response, based on the request, according to the following rules: 1. If the query string contains a key called "format", its value is returned as the content type 2. Otherwise, if the request has an Accepts header, the list of content types in order of preference is returned 3. Otherwise, if the request has a content type, its value is returned

IsBrowserRequest ( this request ) : bool

Determines whether the specified HTTP request was sent by a Browser. A request is considered to be from the browser if it's a GET or POST and has a known User-Agent header (as determined by the request's BrowserCapabilities property), and does not have a non-HTML entity format (XML/JSON)

비공개 메소드들

메소드 설명
HasBody ( this request ) : bool

메소드 상세

GetRequestFormat() 공개 정적인 메소드

Returns the format of a given request.
If the format is unrecognized or not supported.
public static GetRequestFormat ( this request ) : ContentType
request this The request.
리턴 System.Net.Mime.ContentType

GetResponseFormats() 공개 정적인 메소드

Returns the preferred content type to use for the response, based on the request, according to the following rules: 1. If the query string contains a key called "format", its value is returned as the content type 2. Otherwise, if the request has an Accepts header, the list of content types in order of preference is returned 3. Otherwise, if the request has a content type, its value is returned
public static GetResponseFormats ( this request ) : List
request this The request.
리턴 List

IsBrowserRequest() 공개 정적인 메소드

Determines whether the specified HTTP request was sent by a Browser. A request is considered to be from the browser if it's a GET or POST and has a known User-Agent header (as determined by the request's BrowserCapabilities property), and does not have a non-HTML entity format (XML/JSON)
public static IsBrowserRequest ( this request ) : bool
request this The request.
리턴 bool