类 JsonRequest<T>
java.lang.Object
com.android.volley.Request<T>
com.android.volley.toolbox.JsonRequest<T>
- 类型参数:
T- JSON type of response expected
- 所有已实现的接口:
Comparable<Request<T>>
- 直接已知子类:
JsonArrayRequest,JsonObjectRequest
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.
-
嵌套类概要
从类继承的嵌套类/接口 com.android.volley.Request
Request.Method, Request.Priority -
字段概要
字段 -
构造器概要
构造器构造器说明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) 已过时。 -
方法概要
修饰符和类型方法说明protected voiddeliverResponse(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.Returns the content type of the POST or PUT body.byte[]已过时。UsegetBody().已过时。UsegetBodyContentType().parseNetworkResponse(NetworkResponse response) Subclasses must implement this to parse the raw network response and return an appropriate response type.从类继承的方法 com.android.volley.Request
addMarker, cancel, 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, setTag, shouldCache, toString
-
字段详细资料
-
PROTOCOL_CHARSET
Default charset for JSON request.- 另请参阅:
-
-
构造器详细资料
-
JsonRequest
public JsonRequest(String url, String requestBody, Response.Listener<T> listener, Response.ErrorListener errorListener) Deprecated constructor for a JsonRequest which defaults to GET unlessgetPostBody()orRequest.getPostParams()is overridden (which defaults to POST). -
JsonRequest
public JsonRequest(int method, String url, String requestBody, Response.Listener<T> listener, Response.ErrorListener errorListener)
-
-
方法详细资料
-
deliverResponse
从类复制的说明:RequestSubclasses 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.- 指定者:
deliverResponse在类中Request<T>- 参数:
response- The parsed response returned byRequest.parseNetworkResponse(NetworkResponse)
-
parseNetworkResponse
从类复制的说明:RequestSubclasses 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.- 指定者:
parseNetworkResponse在类中Request<T>- 参数:
response- Response from the network- 返回:
- The parsed response, or null in the case of an error
-
getPostBodyContentType
已过时。UsegetBodyContentType().- 覆盖:
getPostBodyContentType在类中Request<T>
-
getPostBody
public byte[] getPostBody()已过时。UsegetBody().从类复制的说明:RequestReturns the raw POST body to be sent.- 覆盖:
getPostBody在类中Request<T>
-
getBodyContentType
从类复制的说明:RequestReturns the content type of the POST or PUT body.- 覆盖:
getBodyContentType在类中Request<T>
-
getBody
public byte[] getBody()从类复制的说明:RequestReturns 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
Request.getBodyContentType()as well to match the new body format.
-
JsonRequest(int, String, String, Listener, ErrorListener).