Class UrlConnectionHttpClient
- java.lang.Object
-
- software.amazon.awssdk.http.urlconnection.UrlConnectionHttpClient
-
- All Implemented Interfaces:
AutoCloseable
,SdkHttpClient
,SdkAutoCloseable
public final class UrlConnectionHttpClient extends Object implements SdkHttpClient
An implementation ofSdkHttpClient
that usesHttpURLConnection
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 Classes Modifier and Type Class Description static interface
UrlConnectionHttpClient.Builder
A builder for an instance ofSdkHttpClient
that uses JDKs build-inURLConnection
HTTP implementation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UrlConnectionHttpClient.Builder
builder()
String
clientName()
void
close()
static SdkHttpClient
create()
Create aHttpURLConnection
client with the default propertiesstatic SdkHttpClient
create(UrlConnectionFactory connectionFactory)
Use this method if you want to control the way aHttpURLConnection
is created.ExecutableHttpRequest
prepareRequest(HttpExecuteRequest request)
-
-
-
Method Detail
-
builder
public static UrlConnectionHttpClient.Builder builder()
-
create
public static SdkHttpClient create()
Create aHttpURLConnection
client with the default properties- Returns:
- an
UrlConnectionHttpClient
-
create
public static SdkHttpClient create(UrlConnectionFactory connectionFactory)
Use this method if you want to control the way aHttpURLConnection
is created. This will ignore SDK defaults likeSdkHttpConfigurationOption.CONNECTION_TIMEOUT
andSdkHttpConfigurationOption.READ_TIMEOUT
- Parameters:
connectionFactory
- a function that, given aURI
will create anHttpURLConnection
- Returns:
- an
UrlConnectionHttpClient
-
prepareRequest
public ExecutableHttpRequest prepareRequest(HttpExecuteRequest request)
- Specified by:
prepareRequest
in interfaceSdkHttpClient
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSdkAutoCloseable
-
clientName
public String clientName()
- Specified by:
clientName
in interfaceSdkHttpClient
-
-