By default, httpclient will not provide credentials preemptively,
it will first create a HTTP request without authentication parameters.
This is by design, as a security precaution, and as part of the spec.
But it causes extra latency to a request, as you need to make multiple calls,
and causes errors to appear in the logs.
So we can use the preemptive basic authentication to avoid useless http
request without authentication.
fix #1
By default, httpclient will not provide credentials preemptively, it will first create a HTTP request without authentication parameters. This is by design, as a security precaution, and as part of the spec.
But it causes extra latency to a request, as you need to make multiple calls, and causes errors to appear in the logs.
So we can use the preemptive basic authentication to avoid useless http request without authentication.