/// <summary> /// Initializes a new instance of the <see cref="JsonMediaTypeFormatter"/> class. /// </summary> public JsonMediaTypeFormatter() { // Set default supported media types SupportedMediaTypes.Add(MediaTypeConstants.ApplicationJsonMediaType); SupportedMediaTypes.Add(MediaTypeConstants.TextJsonMediaType); #if !NETFX_CORE // MediaTypeMappings are not supported in portable library _requestHeaderMapping = new XmlHttpRequestHeaderMapping(); MediaTypeMappings.Add(_requestHeaderMapping); #endif }
/// <summary> /// Initializes a new instance of the <see cref="JsonMediaTypeFormatter"/> class. /// </summary> public JsonMediaTypeFormatter() { // Set default supported media types SupportedMediaTypes.Add(MediaTypeConstants.ApplicationJsonMediaType); SupportedMediaTypes.Add(MediaTypeConstants.TextJsonMediaType); #if !NETFX_CORE // MediaTypeMappings are not supported in portable library _requestHeaderMapping = new XmlHttpRequestHeaderMapping(); MediaTypeMappings.Add(_requestHeaderMapping); #endif }