Reputation: 1797
AuthPNames.CREDENTIAL_CHARSET
is deprecated!?
I don't know how to interpret:
(4.3) use RequestConfig and constructor parameters of AuthSchemeProviders.
From the documentation.
Can anyone give me an example?
Upvotes: 1
Views: 405
Reputation: 27538
Registry<AuthSchemeProvider> authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
.register(AuthSchemes.BASIC, new BasicSchemeFactory(Consts.UTF_8))
.register(AuthSchemes.DIGEST, new DigestSchemeFactory(Consts.UTF_8))
.register(AuthSchemes.NTLM, new NTLMSchemeFactory())
.register(AuthSchemes.SPNEGO, new SPNegoSchemeFactory())
.register(AuthSchemes.KERBEROS, new KerberosSchemeFactory())
.build();
CloseableHttpClient client = HttpClients.custom()
.setDefaultAuthSchemeRegistry(authSchemeRegistry)
.build();
Upvotes: 1