Class Apache5HttpClient
- java.lang.Object
-
- software.amazon.awssdk.http.apache5.Apache5HttpClient
-
- All Implemented Interfaces:
AutoCloseable,SdkHttpClient,SdkAutoCloseable
@SdkPublicApi public final class Apache5HttpClient extends Object implements SdkHttpClient
An implementation ofSdkHttpClientthat 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 Classes Modifier and Type Class Description static interfaceApache5HttpClient.BuilderBuilder for creating an instance ofSdkHttpClient.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Apache5HttpClient.Builderbuilder()StringclientName()voidclose()static SdkHttpClientcreate()Create aApache5HttpClientwith the default propertiesExecutableHttpRequestprepareRequest(HttpExecuteRequest request)
-
-
-
Method Detail
-
builder
public static Apache5HttpClient.Builder builder()
-
create
public static SdkHttpClient create()
Create aApache5HttpClientwith the default properties- Returns:
- an
Apache5HttpClient
-
prepareRequest
public ExecutableHttpRequest prepareRequest(HttpExecuteRequest request)
- Specified by:
prepareRequestin interfaceSdkHttpClient
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSdkAutoCloseable
-
clientName
public String clientName()
- Specified by:
clientNamein interfaceSdkHttpClient
-
-