Class Apache5HttpClient
java.lang.Object
software.amazon.awssdk.http.apache5.Apache5HttpClient
- All Implemented Interfaces:
AutoCloseable,SdkHttpClient,SdkAutoCloseable
An implementation of
SdkHttpClient that uses Apache HttpClient 5.x to communicate with the service. This is a
full-featured synchronous client that adds an extra dependency and higher startup latency compared to
UrlConnectionHttpClient
in exchange for more functionality, like support for HTTP proxies.
This client uses Apache HttpClient 5.x, which provides the following improvements over the Apache HttpClient 4.5.x based client:
- Modern Java ecosystem compatibility including virtual thread support for Java 21
- Active maintenance with regular security updates
- Enhanced logging flexibility through SLF4J (replacing problematic JCL dependencies)
Note: Performance characteristics between Apache 4.5.x and 5.x clients are similar.
See UrlConnectionHttpClient for a lighter-weight alternative implementation.
This can be created via builder()
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBuilder for creating an instance ofSdkHttpClient. -
Method Summary
Modifier and TypeMethodDescriptionstatic Apache5HttpClient.Builderbuilder()voidclose()static SdkHttpClientcreate()Create aApache5HttpClientwith the default propertiesprepareRequest(HttpExecuteRequest request)
-
Method Details
-
builder
-
create
Create aApache5HttpClientwith the default properties- Returns:
- an
Apache5HttpClient
-
prepareRequest
- Specified by:
prepareRequestin interfaceSdkHttpClient
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSdkAutoCloseable
-
clientName
- Specified by:
clientNamein interfaceSdkHttpClient
-