How do you force Protocol.HTTP with java S3 SDKv2?

0

With SDK v1, the protocol could be set via ClientConfiguration:

AmazonS3ClientBuilder.standard()
            .withClientConfiguration(new ClientConfiguration().withProtocol(Protocol.HTTP))
            ...
            .build();

I'm unable to find a similar configuration in S3ClientBuilder, SdkHttpClient.Builder, or a variety of other classes I've looked through (e.g., S3Configuration, SdkClientOption, etc).

My current plan is to useExecutionInterceptor.modifyHttpRequest to force the protocol in SdkHttpRequest but I'm wondering if there's something I've overlooked.

1 réponse
0

Hi - The ClientConfiguration options from 1.11.x have changed in 2.0 of the SDK and don't have direct equivalents. Refer https://github.com/aws/aws-sdk-java-v2/blob/master/docs/LaunchChangelog.md#136-other-options which shows how to use client builder to override the endpoint url.

clientBuilder.endpointOverride(URI.create("http://..."))
AWS
EXPERT
Gokul
répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions