Closed (fixed)
Project:
Services
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Jun 2014 at 20:48 UTC
Updated:
1 Oct 2014 at 21:53 UTC
Jump to comment: Most recent
Comments
Comment #1
texas-bronius commentedComment #2
Atomox commentedBronius, you should be able to use plugins in the browser (Chrome does this by default) to do this, but JSON is not a format-able markup. It sounds like you're really looking for something other than JSON, or some sort of interface which collects your JSON, and alters the display. If you're consuming this service, that would be up to you to build the display, or load it into some environment that will do this for you. However, by default, this is not something that should be the responsibility of services.
Maybe someone else can chime in here on modules that could consume this service, and render it in a mode human-readable way.
Comment #3
texas-bronius commentedHi Atomox- I appreciate your getting back to me.
To be clear, I am not referring to viewing the JSON output as pretty html rendered in the browser viewport but rather just the raw string output in Chrome > Inspector > Network. It's been a while since i'd looked at this specifically, but I am asking how we might be able to get the json output of Services module to include line breaks and whitespace for indenting, and that the native php function json_encode() seemed to have provided that out of the box.
Thanks
-Bronius
Comment #4
kylebrowning commentedIts not currently support, but if you use HTTPie it will do it for you.
Comment #5
Silicon.Valet commentedIt's mashed together because it takes up less space that way. One of the big advantages of JSON for REST calls over say, XML is the comparative brevity. Smaller payloads are quicker payloads.
If you want it pretty printed for convenience of debugging output, use a chrome plugin like JSONView (they'll change your life)