Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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:


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 :)