Wednesday 14 May 2014

How to change FireFox’s default Accept header to JSON

As everyone knows SharePoint 2013 REST APS doesn’t understand the $json, it will render its result in XML, however there are quite a few tools there that can convert XML to JSON. Here I have used the default “Accept” HTTP header of the FireFox browser to see JSON. Steps to change this as follows.
  1.  In the address bar in FireFox, type “about:config”.
  2.  Click the “I promise” button.
  3.  In the search bar type “network.http.accept.default”.
  4.  Double-click the Preference Name.
  5.  Enter the String value as "application/json;odata=verbose"

Now when we use FireFox to view WebApi results it defaults to JSON and not XML


No comments:

Post a Comment