Monday, 31 December 2018

What is ASP.NET Web API MediaTypeFormatter?

MediaTypeFormatter is an abstract class from which 
JsonMediaTypeFormatter and XmlMediaTypeFormatter 
classes inherit from. JsonMediaTypeFormatter handles JSON and XmlMediaTypeFormatter handles XML.

media-type formatter is an object that can:

·       Read CLR objects from an HTTP message body
·       Write CLR objects into an HTTP message body

Web API provides media-type formatters for both JSON and XML. The framework inserts these formatters into the pipeline by default. Clients can request either JSON or XML in the Accept header of the HTTP request.


No comments:

Post a Comment