Quantcast
Channel: Android Retrofit GET request ConversionException issue - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by Jake Wharton for Android Retrofit GET request ConversionException issue

$
0
0

1) Why are these conversion exceptions occurring, when as far as I can tell, the response data is always correct?

You expected data that looks like this:

{"foo":"bar"}

But Gson found something more like:

Hello!

It was expecting a JSON object beginning (aka the { character) but it found a string-like character instead.

2) Does retrofit do any sort of caching for GET requests? This might explain why re-requesting a failed request continues to fail until I kill and restart the application.

Retrofit has no caching whatsoever.

Depending on what HTTP client you are using, it may cache the response of a GET request depending on the headers. Usually you have to opt-in to cache behavior in an HTTP client so if you haven't done that, I doubt it's enabled.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>