Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Weather App Concurrency and Error Handling Making Our Code Asynchronous

i am not getting json data from darksky website API

Why am i getting response.body().toString() value is okhttp3.internal.http.RealResponseBody@23c99a6 from darksky API

1 Answer

Hi Pradeep. Without seeing the rest of our code, it's difficult, but try:

response.body().string() 

instead of (...).toString()

toString() converts an Object into a String (a String representation of an Object if you prefer). That's what okhttp3.internal.http.RealResponseBody@23c99a6 is here. To get your request's response, you should call: response.body().string();

Hope that helps :)