Class ApiJsonFormatter
public class ApiJsonFormatter : JsonMediaTypeFormatter
- Inheritance
-
ApiJsonFormatter
- Inherited Members
Constructors
ApiJsonFormatter()
public ApiJsonFormatter()
Methods
SetDefaultContentHeaders(Type, HttpContentHeaders, MediaTypeHeaderValue)
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.
public override void SetDefaultContentHeaders(Type type, HttpContentHeaders headers, MediaTypeHeaderValue mediaType)
Parameters
typeTypeThe type of the object being serialized. See ObjectContent.
headersHttpContentHeadersThe content headers that should be configured.
mediaTypeMediaTypeHeaderValueThe authoritative media type. Can be null.