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.Priority
构造器和说明 |
---|
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)
Constructor which defaults to
GET if jsonRequest is
null , POST otherwise. |
限定符和类型 | 方法和说明 |
---|---|
protected Response<org.json.JSONObject> |
parseNetworkResponse(NetworkResponse response)
Subclasses must implement this to parse the raw network response
and return an appropriate response type.
|
deliverResponse, getBody, getBodyContentType, getPostBody, getPostBodyContentType
addMarker, cancel, compareTo, deliverError, getCacheEntry, getCacheKey, getHeaders, getMethod, getOriginUrl, getParams, getParamsEncoding, getPostParams, getPostParamsEncoding, getPriority, getRetryPolicy, getSequence, getTag, getTimeoutMs, getTrafficStatsTag, getUrl, hasHadResponseDelivered, isCanceled, markDelivered, parseNetworkError, setCacheEntry, setRedirectUrl, setRequestQueue, setRetryPolicy, setSequence, setShouldCache, setTag, shouldCache, toString
public JsonObjectRequest(int method, java.lang.String url, org.json.JSONObject jsonRequest, Response.Listener<org.json.JSONObject> listener, Response.ErrorListener errorListener)
method
- the HTTP method to useurl
- URL to fetch the JSON fromjsonRequest
- A JSONObject
to post with the request. Null is allowed and
indicates no parameters will be posted along with request.listener
- Listener to receive the JSON responseerrorListener
- Error listener, or null to ignore errors.public JsonObjectRequest(java.lang.String url, org.json.JSONObject jsonRequest, Response.Listener<org.json.JSONObject> listener, Response.ErrorListener errorListener)
GET
if jsonRequest
is
null
, POST
otherwise.#JsonObjectRequest(int, String, JSONObject, Listener, ErrorListener)
protected Response<org.json.JSONObject> parseNetworkResponse(NetworkResponse response)
Request
parseNetworkResponse
在类中 JsonRequest<org.json.JSONObject>
response
- Response from the network