When a browser receives an HTTP redirect code, it will always execute GET or HEAD for a given URL by standard. This is why data must be sent along the lines of the query. If you want to simulate POST redirection, you can send your client a form with the necessary information, and in the event of a page load event, you automatically submit the form using Javascript (usually used to communicate between different servers using the SAML protocol). Here is an example:
<form name="myRedirectForm" action="https://processthis.com/process" method="post"> <input name="name" type="hidden" value="xyz" /> <input name="phone" type="hidden" value="9898989898" /> <noscript> <input type="submit" value="Click here to continue" /> </noscript> </form> <script type="text/javascript"> $(document).ready(function() { document.myRedirectForm.submit(); }); </script>
Side note: If you already have information on your server, why are you sending a redirect instead of doing this? Perhaps you want to implement the POST / REDIRECT / GET pattern?
source share