java.lang.Object | ||
↳ | com.android.volley.Request<T> | |
↳ | com.android.volley.toolbox.JsonRequest<T> |
Known Direct Subclasses |
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.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | PROTOCOL_CHARSET | Default charset for JSON request. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
JsonRequest(String url, String requestBody, Listener<T> listener, Response.ErrorListener errorListener)
This constructor is deprecated.
Use
JsonRequest(int, String, String, Listener, ErrorListener) .
| |||||||||||
JsonRequest(int method, String url, String requestBody, Listener<T> listener, Response.ErrorListener errorListener) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
byte[] |
getBody()
Returns the raw POST or PUT body to be sent.
| ||||||||||
String |
getBodyContentType()
Returns the content type of the POST or PUT body.
| ||||||||||
byte[] |
getPostBody()
This method is deprecated.
Use
getBody() .
| ||||||||||
String |
getPostBodyContentType()
This method is deprecated.
Use
getBodyContentType() .
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
deliverResponse(T response)
Subclasses must implement this to perform delivery of the parsed
response to their listeners.
| ||||||||||
abstract Response<T> |
parseNetworkResponse(NetworkResponse response)
Subclasses must implement this to parse the raw network response
and return an appropriate response type.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.android.volley.Request
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Comparable
|
Default charset for JSON request.
This constructor is deprecated.
Use JsonRequest(int, String, String, Listener, ErrorListener)
.
Deprecated constructor for a JsonRequest which defaults to GET unless getPostBody()
or getPostParams()
is overridden (which defaults to POST).
Returns the raw POST or PUT body to be sent.
By default, the body consists of the request parameters in
application/x-www-form-urlencoded format. When overriding this method, consider overriding
getBodyContentType()
as well to match the new body format.
Returns the content type of the POST or PUT body.
Subclasses must implement this to perform delivery of the parsed response to their listeners. The given response is guaranteed to be non-null; responses that fail to parse are not delivered.
response | The parsed response returned by
parseNetworkResponse(NetworkResponse)
|
---|
Subclasses must implement this to parse the raw network response and return an appropriate response type. This method will be called from a worker thread. The response will not be delivered if you return null.
response | Response from the network |
---|