Share via


XmlHttpRequestHeaderMapping Class

A RequestHeaderMapping that maps the X-Requested-With http header field set by AJAX XmlHttpRequest (XHR) to the media type application/json if no explicit Accept header fields are present in the request.

Inheritance Hierarchy

System.Object
  System.Net.Http.Formatting.MediaTypeMapping
    System.Net.Http.Formatting.RequestHeaderMapping
      System.Net.Http.Formatting.XmlHttpRequestHeaderMapping

Namespace:  System.Net.Http.Formatting
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

Syntax

'Declaration
Public Class XmlHttpRequestHeaderMapping _
    Inherits RequestHeaderMapping
'Usage
Dim instance As XmlHttpRequestHeaderMapping
public class XmlHttpRequestHeaderMapping : RequestHeaderMapping
public ref class XmlHttpRequestHeaderMapping : public RequestHeaderMapping
type XmlHttpRequestHeaderMapping =  
    class 
        inherit RequestHeaderMapping 
    end
public class XmlHttpRequestHeaderMapping extends RequestHeaderMapping

The XmlHttpRequestHeaderMapping type exposes the following members.

Constructors

  Name Description
Public method XmlHttpRequestHeaderMapping Initializes a new instance of XmlHttpRequestHeaderMapping class

Top

Properties

  Name Description
Public property HeaderName Gets the name of the header to match. (Inherited from RequestHeaderMapping.)
Public property HeaderValue Gets the header value to match. (Inherited from RequestHeaderMapping.)
Public property HeaderValueComparison Gets the StringComparison to use when matching [M:HeaderValue]. (Inherited from RequestHeaderMapping.)
Public property IsValueSubstring Gets a value indicating whether [M:HeaderValue] is a matched as a substring of the actual header value. this instance is value substring. (Inherited from RequestHeaderMapping.)
Public property MediaType Gets the MediaTypeHeaderValue that is associated with HttpRequestMessage or HttpResponseMessage instances that have the given characteristics of the MediaTypeMapping. (Inherited from MediaTypeMapping.)

Top

Methods

  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)
Public method TryMatchMediaType Returns a value indicating whether the current RequestHeaderMapping instance can return a MediaTypeHeaderValue from request. (Overrides RequestHeaderMapping.TryMatchMediaType(HttpRequestMessage).)

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Net.Http.Formatting Namespace