A wrapper around the simplejson library for indenting JSON strings.
The url parameter can be used to refer to a page of JSON content to be indented. The value must be URL encoded.
Alternatively, the content parameter can be used to include the JSON in the GET request itself.
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.
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=http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=madonna&results=2&output=json
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=http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=madonna&results=2&output=jsonCopyright DeWitt Clinton - Source - Discuss