public class HttpUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpUtils.Response
A static holder storing HTTP response fields.
|
| Modifier and Type | Method and Description |
|---|---|
static HttpUtils.Response |
doGET(String url,
Collection<org.apache.http.NameValuePair> params,
Collection<org.apache.http.Header> headers,
String user,
String password,
int timeoutMillis,
org.apache.http.client.RedirectStrategy redirectStrategy)
Opens a HTTP/1.1 connection to the given URL using the GET method, decompresses
compressed response streams, if supported by the server.
|
public static HttpUtils.Response doGET(String url, Collection<org.apache.http.NameValuePair> params, Collection<org.apache.http.Header> headers, String user, String password, int timeoutMillis, org.apache.http.client.RedirectStrategy redirectStrategy) throws IOException
url - The URL to open. The URL must be properly escaped, this method will
not perform any escaping.params - Query string parameters to be attached to the url.headers - Any extra HTTP headers to add to the request.user - if not null, the user name to send during Basic
Authenticationpassword - if not null, the password name to send during Basic
AuthenticationHttpUtils.Response object. Note that entire payload is read and
buffered so that the HTTP connection can be closed when leaving this
method.IOException