Home >Backend Development >Golang >Why Do Browsers Not Automatically Re-submit POST Data After a Redirect?
The issue arises from security concerns. When the server sends a redirect to the browser, the browser will switch to sending a basic GET request instead of repeating the POST request. This is because the browser cannot decide for the user whether they would like to send the same data to the new URL as was intended for the original URL, especially when it comes to sensitive data like passwords and credit card numbers. It is not advisable to attempt to circumvent this issue; rather, it is recommended to use a registered path for the POST request or implement the other suggestions from the linked questions.
For more context, refer to the question, "Go web server is automatically redirecting POST requests."
Additional information can be found here:
"Why doesn't HTTP have POST redirect?"
The above is the detailed content of Why Do Browsers Not Automatically Re-submit POST Data After a Redirect?. For more information, please follow other related articles on the PHP Chinese website!