public class UrlHttpClient extends java.lang.Object implements HttpClient
HttpClient by HttpURLConnection. This is
the recommended HTTP client in Android. Compared to ApacheHttpClient,
it has one limitation. When handling 'Expected 100-continue' header, it only
accepts either 100 continue or 417 reject, and throws
ProtocolException on other status code. Such limitation will cause
some issue when talking to S3 service. See S3's
Put Object API for the requirement of handling 100-continue.| Modifier and Type | Class and Description |
|---|---|
protected class |
UrlHttpClient.CurlBuilder
Helper class to build a curl message.
|
| Constructor and Description |
|---|
UrlHttpClient(ClientConfiguration config)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
execute(HttpRequest request)
Executes a
HttpRequest and returns a HttpResponse. |
protected java.net.HttpURLConnection |
getUrlConnection(java.net.URL url) |
protected void |
printToLog(java.lang.String message) |
void |
shutdown()
This is no op.
|
public UrlHttpClient(ClientConfiguration config)
config - the client config.public HttpResponse execute(HttpRequest request) throws java.io.IOException
HttpClientHttpRequest and returns a HttpResponse.execute in interface HttpClientrequest - a HTTP requestjava.io.IOException - in case of a connection problempublic void shutdown()
shutdown in interface HttpClientprotected void printToLog(java.lang.String message)
protected java.net.HttpURLConnection getUrlConnection(java.net.URL url)
throws java.io.IOException
java.io.IOException