Closed renatoathaydes closed 9 years ago
I think this is because of the HTTP Client, which does not send the credentials in the first request, only providing it in case the server returns a 401 first.
It would be really nice to be able to force the HTTP client to send the credentials in the first try... I've read the docs of HTTP Client and I know they do not want to encourage this, but for testing, at least, this is essential.
Confirmed the above. The server did not send the WWW-Authenticate header, that's why the http client did not bother trying to send credentials. But I still would really appreciate if it would be possible to send the credentials in the first try... I might make a PR adding that if you think it's a good idea.
Instead of using the helper methods for sending the basic auth credentials, you'll just need to build the auth header and value yourself. It's pretty simple code to write. There isn't any way I know of to force the HTTP client to pass them on the first call.
I agree. Thanks.
Here's my code:
The server just does not receive the authorization header. Am I doing something wrong or is this a problem with the builder?