Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

11
  • 24
    In the constructor add this.SerializerSettings.Formatting = Formatting.Indented; if you want it pretty-printed without a browser extension. Commented May 15, 2014 at 14:48
  • 11
    why would you want it to pretty print over the wire? Commented Jul 10, 2014 at 21:04
  • 9
    Isn't @dmit77 's Answer better (more concise) than this one? Commented Dec 1, 2014 at 12:00
  • 9
    @eddiegroves you dont want pretty-print over the wire. You want the server to send the least amount of bits over the wire (ie: no spaces). Then you want the browser to format it nicely, with addons and such. Javascript needs to parse the JSON usually, why make it slower by introducing unnecessary formatting Commented Feb 12, 2015 at 20:53
  • 15
    For the googlers who are looking for: don't forget to add using System.Net.Http.Formatting and using Newtonsoft.Json Commented Sep 16, 2015 at 1:46