I am working on an application and am using to fetch, create and update data on a server. For some reason, a lot of my API requests are not working properly all of a sudden. The main issue is when I am PUTting to my server with some data and I receive a 304 in response. I am using the following method for making the request:
Builders.Any.B b = Ion.with(context).load(httpMethod, url).addHeader(Headers.AUTHORIZATION, Headers.AUTH_PREFIX + authToken);
if (!TextUtils.isEmpty(params)) {
b.setStringBody(params);
}
if (headers != null) {
for (Map.Entry<String, String> entry : headers.entrySet()) {
b.addHeader(entry.getKey(), entry.getValue());
}
}
b.group(group).asString().withResponse().setCallback(callback);
What happens is that the callback method is never called. I also tried with the following instead:
// Same code as above except the following line:
try{
Response<String> response = b.group(group).asString().withResponse().get();
// This code is never reached. Simply sits until I cancel it and then it will go into the Exception below.
Log.d("", "");
} catch(Exception e){
// Exception catching here...
}
As stated in the code above, the method never finishes. When I cancel, it will go into the exception. The thing I find strange is that, it not only doesn't respect the timeout, but the logs act as if it were completed:
Hello,
I am working on an application and am using to fetch, create and update data on a server. For some reason, a lot of my API requests are not working properly all of a sudden. The main issue is when I am PUTting to my server with some data and I receive a 304 in response. I am using the following method for making the request:
What happens is that the callback method is never called. I also tried with the following instead:
As stated in the code above, the method never finishes. When I cancel, it will go into the exception. The thing I find strange is that, it not only doesn't respect the timeout, but the logs act as if it were completed:
Any idea what's going on here?