JsonRequestpublic abstract class JsonRequest extends com.android.volley.Request A request for retrieving a T type response body at a given URL that also
optionally sends along a JSON body in the request specified. |
Fields Summary |
---|
private static final String | PROTOCOL_CHARSETCharset for request. | private static final String | PROTOCOL_CONTENT_TYPEContent type for request. | private final com.android.volley.Response.Listener | mListener | private final String | mRequestBody |
Constructors Summary |
---|
public JsonRequest(String url, String requestBody, com.android.volley.Response.Listener listener, com.android.volley.Response.ErrorListener errorListener)Deprecated constructor for a JsonRequest which defaults to GET unless {@link #getPostBody()}
or {@link #getPostParams()} is overridden (which defaults to POST).
this(Method.DEPRECATED_GET_OR_POST, url, requestBody, listener, errorListener);
| public JsonRequest(int method, String url, String requestBody, com.android.volley.Response.Listener listener, com.android.volley.Response.ErrorListener errorListener)
super(method, url, errorListener);
mListener = listener;
mRequestBody = requestBody;
|
Methods Summary |
---|
protected void | deliverResponse(T response)
mListener.onResponse(response);
| public byte[] | getBody()
try {
return mRequestBody == null ? null : mRequestBody.getBytes(PROTOCOL_CHARSET);
} catch (UnsupportedEncodingException uee) {
VolleyLog.wtf("Unsupported Encoding while trying to get the bytes of %s using %s",
mRequestBody, PROTOCOL_CHARSET);
return null;
}
| public java.lang.String | getBodyContentType()
return PROTOCOL_CONTENT_TYPE;
| public byte[] | getPostBody()
return getBody();
| public java.lang.String | getPostBodyContentType()
return getBodyContentType();
| protected abstract com.android.volley.Response | parseNetworkResponse(com.android.volley.NetworkResponse response)
|
|