fixed response parsing in post request template [android-volley]

This commit is contained in:
Shyri Villar 2015-11-08 09:13:28 +01:00
parent 2e4f6dc0a1
commit 5cfcb0b60b

View File

@ -49,7 +49,13 @@ public class PostRequest extends Request<String> {
@Override
protected Response<String> parseNetworkResponse(NetworkResponse response) {
return Response.success("Uploaded", getCacheEntry());
String parsed;
try {
parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers));
} catch (UnsupportedEncodingException e) {
parsed = new String(response.data);
}
return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response));
}
@Override