public class GsonRequest<T>
extends com.nativex.network.volley.Request<T>
| Modifier and Type | Field and Description |
|---|---|
private static String |
ACCEPT
Accept type for request.
|
private static String |
ACCEPT_TYPE |
private Map<String,String> |
headers |
private Gson |
mGson |
private Class<T> |
mJavaClass |
private com.nativex.network.volley.Response.Listener<T> |
mListener |
private String |
mRequestBody |
private static String |
PROTOCOL_CHARSET
Charset for request.
|
private static String |
PROTOCOL_CONTENT_TYPE
Content type for request.
|
| Constructor and Description |
|---|
GsonRequest(int method,
String url,
Class<T> cls,
String requestBody,
com.nativex.network.volley.Response.Listener<T> listener,
com.nativex.network.volley.Response.ErrorListener errorListener) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
deliverResponse(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.
|
String |
getBodyContentType() |
Map<String,String> |
getHeaders()
Returns a list of extra HTTP headers to go along with this request.
|
protected com.nativex.network.volley.Response<T> |
parseNetworkResponse(com.nativex.network.volley.NetworkResponse response)
Subclasses must implement this to parse the raw network response
and return an appropriate response type.
|
void |
setHeader(String key,
String value) |
addMarker, cancel, compareTo, deliverError, getCacheEntry, getCacheKey, getMethod, getParams, getParamsEncoding, getPostBody, getPostBodyContentType, getPostParams, getPostParamsEncoding, getPriority, getRequestName, getRetryPolicy, getSequence, getTag, getTimeoutMs, getTrafficStatsTag, getUrl, hasHadResponseDelivered, isCanceled, isLoggingEnabled, markDelivered, parseNetworkError, postExecuteImmediatelyAfter, preExecuteJustBefore, setCacheEntry, setRequestName, setRequestQueue, setRetryPolicy, setSequence, setShouldCache, setTag, shouldCache, toStringprivate static final String PROTOCOL_CHARSET
private static final String PROTOCOL_CONTENT_TYPE
private static final String ACCEPT
private static final String ACCEPT_TYPE
private final com.nativex.network.volley.Response.Listener<T> mListener
private final String mRequestBody
private Gson mGson
protected void deliverResponse(T response)
com.nativex.network.volley.RequestdeliverResponse in class com.nativex.network.volley.Request<T>response - The parsed response returned by
Request.parseNetworkResponse(NetworkResponse)public Map<String,String> getHeaders() throws com.nativex.network.volley.AuthFailureError
com.nativex.network.volley.RequestAuthFailureError as authentication may be required to
provide these values.getHeaders in class com.nativex.network.volley.Request<T>com.nativex.network.volley.AuthFailureError - In the event of auth failureprotected com.nativex.network.volley.Response<T> parseNetworkResponse(com.nativex.network.volley.NetworkResponse response)
com.nativex.network.volley.RequestparseNetworkResponse in class com.nativex.network.volley.Request<T>response - Response from the networkpublic String getBodyContentType()
getBodyContentType in class com.nativex.network.volley.Request<T>public byte[] getBody()
com.nativex.network.volley.RequestgetBody in class com.nativex.network.volley.Request<T>