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.Constructor and Description |
---|
UrlHttpClient(ClientConfiguration config)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
HttpResponse |
execute(HttpRequest request)
Executes a
HttpRequest and returns a HttpResponse . |
void |
shutdown()
This is no op.
|
public UrlHttpClient(ClientConfiguration config)
config
- the client config.public HttpResponse execute(HttpRequest request) throws java.io.IOException
HttpClient
HttpRequest
and returns a HttpResponse
.execute
in interface HttpClient
request
- a HTTP requestjava.io.IOException
- in case of a connection problempublic void shutdown()
shutdown
in interface HttpClient
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.