com.android.volley.toolbox
Class HurlStack
java.lang.Object
com.android.volley.toolbox.HurlStack
- All Implemented Interfaces:
- HttpStack
public class HurlStack
- extends Object
- implements HttpStack
An HttpStack
based on HttpURLConnection
.
Nested Class Summary |
static interface |
HurlStack.UrlRewriter
An interface for transforming URLs before use. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HurlStack
public HurlStack()
HurlStack
public HurlStack(HurlStack.UrlRewriter urlRewriter)
- Parameters:
urlRewriter
- Rewriter to use for request URLs
HurlStack
public HurlStack(HurlStack.UrlRewriter urlRewriter,
SSLSocketFactory sslSocketFactory)
- Parameters:
urlRewriter
- Rewriter to use for request URLssslSocketFactory
- SSL factory to use for HTTPS connections
performRequest
public HttpResponse performRequest(Request<?> request,
Map<String,String> additionalHeaders)
throws IOException,
AuthFailureError
- Description copied from interface:
HttpStack
- Performs an HTTP request with the given parameters.
A GET request is sent if request.getPostBody() == null. A POST request is sent otherwise,
and the Content-Type header is set to request.getPostBodyContentType().
- Specified by:
performRequest
in interface HttpStack
- Parameters:
request
- the request to performadditionalHeaders
- additional headers to be sent together with
Request.getHeaders()
- Returns:
- the HTTP response
- Throws:
IOException
AuthFailureError
createConnection
protected HttpURLConnection createConnection(URL url)
throws IOException
- Create an
HttpURLConnection
for the specified url
.
- Throws:
IOException
setConnectionParametersForRequest
static void setConnectionParametersForRequest(HttpURLConnection connection,
Request<?> request)
throws IOException,
AuthFailureError
- Throws:
IOException
AuthFailureError