HTTPClient getting two 401s before success (sending wrong token)

后端 未结 3 2011
说谎
说谎 2021-02-07 11:14

I\'m trying to communicate with a self-hosted WebAPI client using HttpClient. The client is created with the following code:

HttpClientHandler clien         


        
3条回答
  •  后悔当初
    2021-02-07 12:00

    the default behavior where it only sends credentials after receiving an HTTP 401 Not Authorized response.

    Manually adding the credentials header seems to be the best solution available.

    More details in this post

提交回复
热议问题