Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrofit How To Print Out Response JSON

I'm using Retrofit and I want to get access to the JSON response that is returned from the server. Could someone please advise me. Thanks

like image 587
Pan Wangperawong Avatar asked Feb 12 '23 00:02

Pan Wangperawong


1 Answers

if you only want to see the respones for debugging purpose just turn on debugging in retrofit and look at the log. It's something like:

restAdapter.setDebuggingEnabled(true);

If you need access to the direct response in code all of the time, you should be doing that at the httpclient level as it's basically bypassing the purpose of retrofit

like image 193
dabluck Avatar answered Feb 15 '23 10:02

dabluck