Class UrlConnectionHttpClient
java.lang.Object
software.amazon.awssdk.http.urlconnection.UrlConnectionHttpClient
- All Implemented Interfaces:
AutoCloseable,SdkHttpClient,SdkAutoCloseable
An implementation of
SdkHttpClient that uses HttpURLConnection to communicate with the service. This is the
leanest synchronous client that optimizes for minimum dependencies and startup latency in exchange for having less
functionality than other implementations.
See software.amazon.awssdk.http.apache.ApacheHttpClient for an alternative implementation.
This can be created via builder()
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA builder for an instance ofSdkHttpClientthat uses JDKs build-inURLConnectionHTTP implementation. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()voidclose()static SdkHttpClientcreate()Create aHttpURLConnectionclient with the default propertiesstatic SdkHttpClientcreate(UrlConnectionFactory connectionFactory) Use this method if you want to control the way aHttpURLConnectionis created.prepareRequest(HttpExecuteRequest request)
-
Method Details
-
builder
-
create
Create aHttpURLConnectionclient with the default properties- Returns:
- an
UrlConnectionHttpClient
-
create
Use this method if you want to control the way aHttpURLConnectionis created. This will ignore SDK defaults likeSdkHttpConfigurationOption.CONNECTION_TIMEOUTandSdkHttpConfigurationOption.READ_TIMEOUT- Parameters:
connectionFactory- a function that, given aURIwill create anHttpURLConnection- Returns:
- an
UrlConnectionHttpClient
-
prepareRequest
- Specified by:
prepareRequestin interfaceSdkHttpClient
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSdkAutoCloseable
-
clientName
- Specified by:
clientNamein interfaceSdkHttpClient
-