HttpClientBuilder basic auth

后端 未结 4 1603
旧巷少年郎
旧巷少年郎 2020-12-03 05:39

Since HttpClient 4.3, I have been using the HttpClientBuilder. I am connecting to a REST service that has basic authentication. I am setting the credentials as follows:

4条回答
  •  孤街浪徒
    2020-12-03 06:08

    I think HttpClient is like other curl based solution, it follows the spec.

    And the spec is "Do not send the credentials except if server tell you to do so". So you get a 401 ("I want u to send credentials")...

    It's a common soap ui problem: when you don't know, it's not obvious

提交回复
热议问题