T - JSON type of response expectedpublic abstract class JsonRequest<T> extends Request<T>
Request.Method, Request.Priority| Constructor and Description |
|---|
JsonRequest(int method,
java.lang.String url,
java.lang.String requestBody,
Response.Listener<T> listener,
Response.ErrorListener errorListener) |
JsonRequest(java.lang.String url,
java.lang.String requestBody,
Response.Listener<T> listener,
Response.ErrorListener errorListener)
Deprecated.
Use
#JsonRequest(int, String, String, Listener, ErrorListener). |
| Modifier and Type | Method and Description |
|---|---|
protected void |
deliverResponse(T response)
Subclasses must implement this to perform delivery of the parsed
response to their listeners.
|
byte[] |
getBody()
Returns the raw POST or PUT body to be sent.
|
java.lang.String |
getBodyContentType() |
byte[] |
getPostBody()
Deprecated.
Use
getBody(). |
java.lang.String |
getPostBodyContentType()
Deprecated.
Use
getBodyContentType(). |
protected abstract Response<T> |
parseNetworkResponse(NetworkResponse response)
Subclasses must implement this to parse the raw network response
and return an appropriate response type.
|
addMarker, cancel, compareTo, deliverError, getCacheEntry, getCacheKey, getHeaders, getMethod, getParams, getParamsEncoding, getPostParams, getPostParamsEncoding, getPriority, getRetryPolicy, getSequence, getTag, getTimeoutMs, getTrafficStatsTag, getUrl, hasHadResponseDelivered, isCanceled, markDelivered, parseNetworkError, setCacheEntry, setRequestQueue, setRetryPolicy, setSequence, setShouldCache, setTag, shouldCache, toStringpublic JsonRequest(java.lang.String url,
java.lang.String requestBody,
Response.Listener<T> listener,
Response.ErrorListener errorListener)
#JsonRequest(int, String, String, Listener, ErrorListener).getPostBody()
or Request.getPostParams() is overridden (which defaults to POST).public JsonRequest(int method,
java.lang.String url,
java.lang.String requestBody,
Response.Listener<T> listener,
Response.ErrorListener errorListener)
protected void deliverResponse(T response)
RequestdeliverResponse in class Request<T>response - The parsed response returned by
Request.parseNetworkResponse(NetworkResponse)protected abstract Response<T> parseNetworkResponse(NetworkResponse response)
RequestparseNetworkResponse in class Request<T>response - Response from the networkpublic java.lang.String getPostBodyContentType()
getBodyContentType().getPostBodyContentType in class Request<T>public byte[] getPostBody()
getBody().RequestgetPostBody in class Request<T>public java.lang.String getBodyContentType()
getBodyContentType in class Request<T>