MediaTypeFormatter class to handle Xml.
Inheritance Hierarchy
System.Object
  System.Net.Http.Formatting.MediaTypeFormatter
    System.Net.Http.Formatting.XmlMediaTypeFormatter
Namespace:  System.Net.Http.Formatting
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Syntax
'Declaration
Public Class XmlMediaTypeFormatter _
    Inherits MediaTypeFormatter
'Usage
Dim instance As XmlMediaTypeFormatter
public class XmlMediaTypeFormatter : MediaTypeFormatter
public ref class XmlMediaTypeFormatter : public MediaTypeFormatter
type XmlMediaTypeFormatter =  
    class
        inherit MediaTypeFormatter
    end
public class XmlMediaTypeFormatter extends MediaTypeFormatter
The XmlMediaTypeFormatter type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| .jpeg) | XmlMediaTypeFormatter | Initializes a new instance of the XmlMediaTypeFormatter class. | 
Top
Properties
| Name | Description | |
|---|---|---|
| .jpeg) .gif) | DefaultMediaType | Gets the default media type for the XML formatter. | 
| .jpeg) | Indent | Gets or sets a value indicating whether to indent elements when writing data. | 
| .jpeg) | MaxDepth | Gets and sets the maximum nested node depth. | 
| .jpeg) | MediaTypeMappings | Gets the mutable collection of MediaTypeMapping objects that match HTTP requests to media types. (Inherited from MediaTypeFormatter.) | 
| .jpeg) | RequiredMemberSelector | Gets or sets the IRequiredMemberSelector instance used to determine required members. (Inherited from MediaTypeFormatter.) | 
| .jpeg) | SupportedEncodings | Gets the mutable collection of character encodings supported bythis MediaTypeFormatter. (Inherited from MediaTypeFormatter.) | 
| .jpeg) | SupportedMediaTypes | Gets the mutable collection of media types supported bythis MediaTypeFormatter. (Inherited from MediaTypeFormatter.) | 
| .jpeg) | UseXmlSerializer | Gets or sets a value indicating whether the XML formatter uses the XmlSerializer as the default serializer, instead of using the DataContractSerializer. | 
Top
Methods
| Name | Description | |
|---|---|---|
| .jpeg) | CanReadType | Queries whether the XmlMediaTypeFormatter can deserializean object of the specified type. (Overrides MediaTypeFormatter.CanReadType(Type).) | 
| .jpeg) | CanWriteType | Queries whether the XmlMediaTypeFormatter can serializean object of the specified type. (Overrides MediaTypeFormatter.CanWriteType(Type).) | 
| .jpeg) | Equals | (Inherited from Object.) | 
| .jpeg) | Finalize | (Inherited from Object.) | 
| .jpeg) | GetHashCode | (Inherited from Object.) | 
| .jpeg) | GetPerRequestFormatterInstance | Returns a specialized instance of the MediaTypeFormatter that can format a response for the given parameters. (Inherited from MediaTypeFormatter.) | 
| .jpeg) | GetType | (Inherited from Object.) | 
| .jpeg) | MemberwiseClone | (Inherited from Object.) | 
| .jpeg) | ReadFromStreamAsync | Called during deserialization to read an object of the specified type from the specified readStream. (Overrides MediaTypeFormatter.ReadFromStreamAsync(Type, Stream, HttpContent, IFormatterLogger).) | 
| .jpeg) | RemoveSerializer | Unregisters the serializer currently associated with the given type. | 
| .jpeg) | SelectCharacterEncoding | Determines the best character encoding for reading or writing an HTTP entity body, given a set of content headers. (Inherited from MediaTypeFormatter.) | 
| .jpeg) | SetDefaultContentHeaders | Sets the default headers for content that will be formatted using this formatter. This method is called from the ObjectContent constructor. This implementation sets the Content-Type header to the value of mediaType if it is not null. If it is null it sets the Content-Type to the default media type of this formatter. If the Content-Type does not specify a charset it will set it using this formatters configured Encoding. (Inherited from MediaTypeFormatter.) | 
| .jpeg) | SetSerializer(Type, XmlObjectSerializer) | Registers an XmlObjectSerializer to read or write objects of a specified type. | 
| .jpeg) | SetSerializer(Type, XmlSerializer) | Registers an XmlSerializer to read or write objects of a specified type. | 
| .jpeg) | SetSerializer<T>(XmlObjectSerializer) | Registers an XmlObjectSerializer to read or write objects of a specified type. | 
| .jpeg) | SetSerializer<T>(XmlSerializer) | Registers an XmlSerializer to read or write objects of a specified type. | 
| .jpeg) | ToString | (Inherited from Object.) | 
| .jpeg) | WriteToStreamAsync | Called during serialization to write an object of the specified type to the specified writeStream. (Overrides MediaTypeFormatter.WriteToStreamAsync(Type, Object, Stream, HttpContent, TransportContext).) | 
Top
Extension Methods
| Name | Description | |
|---|---|---|
| .gif) | AddQueryStringMapping(String, String, MediaTypeHeaderValue) | Overloaded. Updates the given set of formatter of MediaTypeMapping elements so that it associates the mediaType with Uris containing a specific query parameter and value. (Defined by MediaTypeFormatterExtensions.) | 
| .gif) | AddQueryStringMapping(String, String, String) | Overloaded. Updates the given set of formatter of MediaTypeMapping elements so that it associates the mediaType with Uris containing a specific query parameter and value. (Defined by MediaTypeFormatterExtensions.) | 
| .gif) | AddRequestHeaderMapping(String, String, StringComparison, Boolean, MediaTypeHeaderValue) | Overloaded. Updates the given set of formatter of MediaTypeMapping elements so that it associates the mediaType with a specific HTTP request header field with a specific value. (Defined by MediaTypeFormatterExtensions.) | 
| .gif) | AddRequestHeaderMapping(String, String, StringComparison, Boolean, String) | Overloaded. Updates the given set of formatter of MediaTypeMapping elements so that it associates the mediaType with a specific HTTP request header field with a specific value. (Defined by MediaTypeFormatterExtensions.) | 
| .gif) | AddUriPathExtensionMapping(String, MediaTypeHeaderValue) | Overloaded. Updates the given formatter's set of MediaTypeMapping elements so that it associates the mediaType with Uris ending with the given uriPathExtension. (Defined by MediaTypeFormatterExtensions.) | 
| .gif) | AddUriPathExtensionMapping(String, String) | Overloaded. Updates the given formatter's set of MediaTypeMapping elements so that it associates the mediaType with Uris ending with the given uriPathExtension. (Defined by MediaTypeFormatterExtensions.) | 
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.