I have a problem with redirecting requests. I have an incoming GET or POST for http://foo.com/bar?A=b. I redirect it with HTTP 307 to http://hockily.com/dockily?C=d&E=f.
But at hockily.com , I have both the A, C and E. A is on GET parameters, C and E are on POST parameters. I need to remove the A. I should not send it. How can I do that?
I’m using Java’s Response for a return like
return Response.temporaryRedirect(
URI.create((String) s.get("redirectString"))
).build();
Please feel free to comment for extra information that I couldn’t think of to provide.
The correct HTTP status code for redirecting a client to GET from a new URI after a POST request is 303. You should use the
seeOther()method instead.