I have a POST request, which I tried first in Postman, I wanted to capture the status code before it's redirected. In Postman, I got 307 (I set the settings so it doesn't follow redirects).
But when I tried using restassured, it still got redirected, so I got 200 status code instead of 307.
Tried the same way with GET request with 302 status code, and that one works.
public void postDataBeforeLogin() {
//post data before login
Response response = RestAssured.given().redirects().follow(false).post("/data");
assertEquals(response.getStatusCode(), 307);
}
I read an article/post about restassured not redirecting POST requests, but it was from 3 years ago, so I'm not sure if that is still the case.
Can anyone help/clarify?
Help will be greatly appreciated, thank you!