public class HurlStack extends Object implements HttpStack
HttpStack based on HttpURLConnection.| 限定符和类型 | 类和说明 |
|---|---|
static interface |
HurlStack.UrlRewriter
An interface for transforming URLs before use.
|
| 构造器和说明 |
|---|
HurlStack() |
HurlStack(HurlStack.UrlRewriter urlRewriter) |
HurlStack(HurlStack.UrlRewriter urlRewriter,
SSLSocketFactory sslSocketFactory) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected HttpURLConnection |
createConnection(URL url)
Create an
HttpURLConnection for the specified url. |
org.apache.http.HttpResponse |
performRequest(Request<?> request,
Map<String,String> additionalHeaders)
Performs an HTTP request with the given parameters.
|
public HurlStack()
public HurlStack(HurlStack.UrlRewriter urlRewriter)
urlRewriter - Rewriter to use for request URLspublic HurlStack(HurlStack.UrlRewriter urlRewriter, SSLSocketFactory sslSocketFactory)
urlRewriter - Rewriter to use for request URLssslSocketFactory - SSL factory to use for HTTPS connectionspublic org.apache.http.HttpResponse performRequest(Request<?> request, Map<String,String> additionalHeaders) throws IOException, AuthFailureError
HttpStackA GET request is sent if request.getPostBody() == null. A POST request is sent otherwise, and the Content-Type header is set to request.getPostBodyContentType().
performRequest 在接口中 HttpStackrequest - the request to performadditionalHeaders - additional headers to be sent together with
Request.getHeaders()IOExceptionAuthFailureErrorprotected HttpURLConnection createConnection(URL url) throws IOException
HttpURLConnection for the specified url.IOExceptionCopyright © 2018. All rights reserved.