jgilfelt / chuck

An in-app HTTP inspector for Android OkHttp clients
Apache License 2.0
4.68k stars 452 forks source link

JSON is not pretty print. #53

Closed ghost closed 7 years ago

ghost commented 7 years ago

JSON should be pretty print. please add this line String prettyJson = new JSONObject(bodyString).toString(2) bodyText.setText(prettyJson)

mannodermaus commented 7 years ago

The library uses Gson to format JSON content properly. Maybe your body's Content-Type isn't set to application/json?

ghost commented 7 years ago

Thanks aurae. Yes, Issue at the server side. and default it is set to the text/html. now we changed the Content-Type and now it works like a charm :). big thanks to you :)