json-indent

A Google App Engine app written in Go for indenting JSON strings.

Bookmarklet (drag to toolbar)

json-indent

GET requests

The url parameter can be used to refer to a page of JSON content to be indented. The value must be URL encoded.

Demonstration using GET

Alternatively, the content parameter can be used to include the JSON in the GET request itself.

POST requests

POST requests to /indent can be either multipart/form-data or application/x-www-form-urlencoded encoded. If a key named content is present then the value will be indented. If not, the entire request body will be indented.

Demonstration using POST


JSONP Callbacks

For cross-domain usage directly in web pages, the request can contain the callback parameter, which will wrap the response in a javascript method invocation of the callback's value.

For example:

  • GET /indent?callback=f&url=https://www.googleapis.com/plus/v1/people/+DeWittClinton
  • Colorization

    Output can be colorized and returned as type text/html if the request contains the color=true parameter.

    Note that the color parameter is incompatible with the JSONP callback, as a complete HTML document is returned. See the colorized HTML document for ideas about how the results of a JSONP callback could be embedded directly in an existing document.

    For example:

  • GET /indent?color=true&url=https://www.googleapis.com/plus/v1/people/+DeWittClinton

  • Copyright DeWitt Clinton - Source