Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JAVA Rest-Assured DSL redirects not working

I am trying to configure my rest-assured tests to ignore redirects by using the following code:

RestAssured.config = config().redirect(redirectConfig().followRedirects(true).and().maxRedirects(20));

Rest-Assured DSL

I am doing a PUT on a REST service and I get 302 HTML back because of the redirects, instead of the expected JSON type. Has anyone gotten this to work another away with rest-assured ? Let me know if you need more info


1 Answers

Jayway Link

The above link explains that POST/PUT should get a response of a 303 instead of 302, and since I am getting a 302 on a PUT, rest assured does not support redirects for that. If I do GET and receive a 302, all is well.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!