I need to redirect a user to an external site though a POST request.
The only option I figured out is to do it submit a form through JavaScript.
Any ideas?
It's not quite clear what you mean, so let's take a few scenarios:
User should POST form to a server other than your own
Easy, just specify the target as the form action:
<form action="http://someotherserver.com" method="post">
User should be redirected after a successful POST submit
Easy, accept and process the POST data as usual, then respond with a 302 or 303 redirect header.
302
303
User should POST data to your server and, after validation, you want to POST that data to another server
Slightly tricky, but three options:
307
See here for a list of all HTTP redirection options: http://en.wikipedia.org/wiki/Http_status_codes#3xx_Redirection
2.1m questions
2.1m answers
60 comments
57.0k users