Forum Stats

  • 3,757,144 Users
  • 2,251,201 Discussions
  • 7,869,743 Comments

Discussions

Is HttpClient redirection fixed?

User_LFTFI
User_LFTFI Member Posts: 1 Green Ribbon

I`ve problem with HttpClient (OpenJdk 11).

Service deployed on kubernetes. Client use HttpClient to send POST request by https protocol.

HttpClient configured to always redirect.

We Got 405 response code - service`s endpoint can process only POST request, but got GET request, which get 405 error.

After turn of redirection policy on HttpClient, we found that on first request, client got 302 response.

In Always, Normal behavior HttpClient - such redirection lead to lost method of request (POST request resend as request with default method type - GET)

At now, I have to process 302 (or 301) redirection code to control method of request, but that is not convenient solution...