To work in an environment where there is an opportunity of self-assessment and self-improvement of Software Development Skill both in individual and group based work that will ultimately lead to the further development of an exclusive career in the programming area. I am a Microsoft certified developer.
ASP.NET Web API's default output format is supposed to be JSON, but when I access my Web APIs using the browser address bar I'm always seeing an XML result instead. When working on AJAX application I like to test many of my AJAX APIs with the browser while working on them. While I can't debug all requests this way, GET requests are easy to test in the browser especially if you have JSON viewing options set up in your various browsers.
However I had a situation where I only wanted to return JSON output. Removing the XML formatter can easily be done through the Web API configuration inside your WebApiConfig.cs file:
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Formatters.Remove(config.Formatters.XmlFormatter);
}
}
#Web#API#Restful#Service#RestAPI#core#API2
To work in an environment where there is an opportunity of self-assessment and self-improvement of Software Development Skill both in individual and group based work that will ultimately lead to the further development of an exclusive career in the programming area. I am a Microsoft certified developer. More
No comments:
Post a Comment