public class JsonObjectRequest extends JsonRequest<org.json.JSONObject>
JSONObject response body at a given URL, allowing for an
optional JSONObject to be passed in as part of the request body.Request.Method, Request.PriorityPROTOCOL_CHARSET| Constructor and Description |
|---|
JsonObjectRequest(int method,
java.lang.String url,
org.json.JSONObject jsonRequest,
Response.Listener<org.json.JSONObject> listener,
Response.ErrorListener errorListener)
Creates a new request.
|
JsonObjectRequest(java.lang.String url,
org.json.JSONObject jsonRequest,
Response.Listener<org.json.JSONObject> listener,
Response.ErrorListener errorListener)
Deprecated.
Use
#JsonObjectRequest(int, String, JSONObject, Listener, ErrorListener). |
JsonObjectRequest(java.lang.String url,
Response.Listener<org.json.JSONObject> listener,
Response.ErrorListener errorListener)
Creates a new request.
|
| Modifier and Type | Method and Description |
|---|---|
protected Response<org.json.JSONObject> |
parseNetworkResponse(NetworkResponse response)
Subclasses must implement this to parse the raw network response and return an appropriate
response type.
|
cancel, deliverResponse, getBody, getBodyContentType, getPostBody, getPostBodyContentTypeaddMarker, compareTo, deliverError, getCacheEntry, getCacheKey, getErrorListener, getHeaders, getMethod, getParams, getParamsEncoding, getPostParams, getPostParamsEncoding, getPriority, getRetryPolicy, getSequence, getTag, getTimeoutMs, getTrafficStatsTag, getUrl, hasHadResponseDelivered, isCanceled, markDelivered, parseNetworkError, setCacheEntry, setRequestQueue, setRetryPolicy, setSequence, setShouldCache, setShouldRetryConnectionErrors, setShouldRetryServerErrors, setTag, shouldCache, shouldRetryConnectionErrors, shouldRetryServerErrors, toStringpublic JsonObjectRequest(java.lang.String url,
Response.Listener<org.json.JSONObject> listener,
@Nullable
Response.ErrorListener errorListener)
url - URL to fetch the JSON fromlistener - Listener to receive the JSON responseerrorListener - Error listener, or null to ignore errors.@Deprecated
public JsonObjectRequest(java.lang.String url,
@Nullable
org.json.JSONObject jsonRequest,
Response.Listener<org.json.JSONObject> listener,
@Nullable
Response.ErrorListener errorListener)
#JsonObjectRequest(int, String, JSONObject, Listener, ErrorListener).GET if jsonRequest is null
, POST otherwise.public JsonObjectRequest(int method,
java.lang.String url,
@Nullable
org.json.JSONObject jsonRequest,
Response.Listener<org.json.JSONObject> listener,
@Nullable
Response.ErrorListener errorListener)
method - the HTTP method to useurl - URL to fetch the JSON fromjsonRequest - A JSONObject to post with the request. Null indicates no
parameters will be posted along with request.listener - Listener to receive the JSON responseerrorListener - Error listener, or null to ignore errors.protected Response<org.json.JSONObject> parseNetworkResponse(NetworkResponse response)
RequestparseNetworkResponse in class JsonRequest<org.json.JSONObject>response - Response from the network