Created
June 17, 2013 10:09
-
-
Save smaspe/5795942 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class StringParser implements NewtorkResponseParser<String> { | |
@Override | |
public Response<String> parseResponse(NetworkResponse response) { | |
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)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment