A good way to redirect with a POST request?

前端 未结 4 1549
既然无缘
既然无缘 2020-12-02 14:36

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 id

4条回答
  •  误落风尘
    2020-12-02 15:23

    Just set HTML form's action URL to the particular external site.

    Here's an SSCCE, just copy'n'paste'n'run it:

    
    
        
            SO question 2604530
        
        
            

    You'll see that Stackoverflow has good CSRF protection ;)

提交回复
热议问题