类 StringRequest
- 所有已实现的接口:
Comparable<Request<String>>
A canned request for retrieving the response body at a given URL as a String.
-
嵌套类概要
从类继承的嵌套类/接口 com.android.volley.Request
Request.Method, Request.Priority -
构造器概要
构造器构造器说明StringRequest(int method, String url, Response.Listener<String> listener, Response.ErrorListener errorListener) Creates a new request with the given method.StringRequest(String url, Response.Listener<String> listener, Response.ErrorListener errorListener) Creates a new GET request. -
方法概要
修饰符和类型方法说明protected voiddeliverResponse(String response) Subclasses must implement this to perform delivery of the parsed response to their listeners.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, getBody, getBodyContentType, getCacheEntry, getCacheKey, getErrorListener, getHeaders, getMethod, getParams, getParamsEncoding, getPostBody, getPostBodyContentType, getPostParams, getPostParamsEncoding, getPriority, getRetryPolicy, getSequence, getTag, getTimeoutMs, getTrafficStatsTag, getUrl, hasHadResponseDelivered, isCanceled, markDelivered, parseNetworkError, setCacheEntry, setRequestQueue, setRetryPolicy, setSequence, setShouldCache, setTag, shouldCache, toString
-
构造器详细资料
-
StringRequest
public StringRequest(int method, String url, Response.Listener<String> listener, Response.ErrorListener errorListener) Creates a new request with the given method.- 参数:
method- the requestRequest.Methodto useurl- URL to fetch the string atlistener- Listener to receive the String responseerrorListener- Error listener, or null to ignore errors
-
StringRequest
public StringRequest(String url, Response.Listener<String> listener, Response.ErrorListener errorListener) Creates a new GET request.- 参数:
url- URL to fetch the string atlistener- Listener to receive the String responseerrorListener- Error listener, or null to ignore errors
-
-
方法详细资料
-
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<String>- 参数:
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<String>- 参数:
response- Response from the network- 返回:
- The parsed response, or null in the case of an error
-