StringRequestpublic class StringRequest extends com.android.volley.Request A canned request for retrieving the response body at a given URL as a String. |
Fields Summary |
---|
private final com.android.volley.Response.Listener | mListener |
Constructors Summary |
---|
public StringRequest(int method, String url, com.android.volley.Response.Listener listener, com.android.volley.Response.ErrorListener errorListener)Creates a new request with the given method.
super(method, url, errorListener);
mListener = listener;
| public StringRequest(String url, com.android.volley.Response.Listener listener, com.android.volley.Response.ErrorListener errorListener)Creates a new GET request.
this(Method.GET, url, listener, errorListener);
|
Methods Summary |
---|
protected void | deliverResponse(java.lang.String response)
mListener.onResponse(response);
| protected com.android.volley.Response | parseNetworkResponse(com.android.volley.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));
|
|