|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.android.volley.Request<T> com.android.volley.toolbox.JsonRequest<T>
T
- JSON type of response expectedpublic abstract class JsonRequest<T>
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.android.volley.Request |
---|
Request.Method, Request.Priority |
Constructor Summary | |
---|---|
JsonRequest(int method,
String url,
String requestBody,
Response.Listener<T> listener,
Response.ErrorListener errorListener)
|
|
JsonRequest(String url,
String requestBody,
Response.Listener<T> listener,
Response.ErrorListener errorListener)
Deprecated. Use #JsonRequest(int, String, String, Listener, ErrorListener) . |
Method Summary | |
---|---|
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. |
String |
getBodyContentType()
|
byte[] |
getPostBody()
Deprecated. Use getBody() . |
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. |
Methods inherited from class com.android.volley.Request |
---|
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, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JsonRequest(String url, 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, String url, String requestBody, Response.Listener<T> listener, Response.ErrorListener errorListener)
Method Detail |
---|
protected void deliverResponse(T response)
Request
deliverResponse
in class Request<T>
response
- The parsed response returned by
Request.parseNetworkResponse(NetworkResponse)
protected abstract Response<T> parseNetworkResponse(NetworkResponse response)
Request
parseNetworkResponse
in class Request<T>
response
- Response from the network
public String getPostBodyContentType()
getBodyContentType()
.
getPostBodyContentType
in class Request<T>
public byte[] getPostBody()
getBody()
.
Request
getPostBody
in class Request<T>
public String getBodyContentType()
getBodyContentType
in class Request<T>
public byte[] getBody()
Request
getBody
in class Request<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |