Please Login to Continue

Free Software Development Articles.Email List
How to Draw Realistic Photos (E-Book)

How to Draw Realistic Photos (E-Book)

$1

Why Software Development Need Ethics to Succeed (E-Book)

Why Software Development Need Ethics to Succeed (E-Book)

$1

How to Make a Social Media Website in Easy Steps

How to Make a Social Media Website in Easy Steps

$1

Web API Return Pure Json Data

Web API Return Pure JSON Data

When working with Web API, it is important to return data in the response in form of JSON Data so that a Client consuming the data won't do much to clean the data. You could append or define a format of data expected to be returned in the Http Header when making a request, however, in this case, we want to return pure JSON and make it a Web API standard.

Solution:

Just add the code below in the WebApiConfig.cs file and problem solved:
//Remove xml formatter
            config.Formatters.Remove(config.Formatters.XmlFormatter);
Technology published
Buy Me Coffee

Was this page helpful?

Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful..



© 2020 - ErnesTech - Privacy