I've been using Volley for a while but today I'm facing a very weird problem. I'm making a Post JsonRequest successfully, but if I try again the request to the same service it fails, if I try once again it's successful and so on.
If the request is successful and I restart the app, the next request will still be successful, then it fails, it succeed and so on.
The same happens with a StringRequest.
What happens is that in HurlStack class I fall in this if:
if (responseCode == -1) {
// -1 is returned by getResponseCode() if the response code could not be retrieved.
// Signal to the caller that something was wrong with the connection.
throw new IOException("Could not retrieve response code from HttpUrlConnection.");
}
but I know that even in this case the request was correctly posted to the server (I checked the logs).