DefaultFormatHelper Class

 

Represents the default implementation of FormatHelper The results for GetRequestFormat() and GetResponseFormats() are cached on the HttpContext.Items dictionary: HttpContext.Items["requestFormat"] HttpContext.Items["responseFormat"].

Namespace:   Microsoft.Web.Mvc.Resources
Assembly:  Microsoft.Web.Mvc (in Microsoft.Web.Mvc.dll)

System.Object
  Microsoft.Web.Mvc.Resources.FormatHelper
    Microsoft.Web.Mvc.Resources.DefaultFormatHelper

type DefaultFormatHelper = 
    class
        inherit FormatHelper
    end

NameDescription
System_CAPS_pubmethodDefaultFormatHelper()

Initializes a new instance of the DefaultFormatHelper class.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetRequestFormat(RequestContext)

Returns the format of a given request, according to the following rules: 1. If a Content-Type header exists it returns a ContentType for it or fails if one can't be created 2. Otherwise, if a Content-Type header does not exists it provides the default ContentType of "application/octet-stream" (per RFC 2616 7.2.1).(Overrides FormatHelper.GetRequestFormat(RequestContext).)

System_CAPS_pubmethodGetResponseFormats(RequestContext)

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

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodIsBrowserRequest(RequestContext)

Determines whether the specified HTTP request was sent by a Browser.(Overrides FormatHelper.IsBrowserRequest(RequestContext).)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

NameDescription
System_CAPS_pubfieldSystem_CAPS_staticRequestFormatKey

Represents the request format key.

System_CAPS_pubfieldSystem_CAPS_staticResponseFormatKey

Represents the response format key.

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: