RestEasy ClientRequest followRedirect behaviour on POST
-
01-10-2019 - |
Question
To my knowledge the correct way, in a restful sense, to handle creation of a new resource is to POST the request and then redirect the client to the result via header location field.
It seems ClientRequest does not support this. I cannot get the ClientRequest to automatically follow the see other (303) redirect after a post. When a PostMethod is created by the RestEasy client framework followRedirect is set to false ignoring the followRedirect set on the ClientRequest.
Is there another way?
Solution
The API has been specifically implemented to not automatically follow redirects.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow