What is the correct behavior expected of an HTTP POST => 302 redirect to GET?

后端 未结 3 1386
没有蜡笔的小新
没有蜡笔的小新 2020-12-03 06:58

What is the correct behavior expected of a POST => 302 redirect to GET?

In chrome (and likely most every browser), after I POST (to a resource that wants me to redi

3条回答
  •  鱼传尺愫
    2020-12-03 07:38

    abarnert was right ! I had the same issue with Google App Engine but I found a different solution.

    My issue with appengine was,I did a POST with a form to a GO formHandler at backend. But it was executed as follow.

    request 1: GET /formHandler -> response 1: 302 Found

    request 1: POST /formHandler -> response 1: 302 Found

    request 1: GET /formHandler -> response 1: 200 Ok.

    Additionaly I got

    No 'Access-Control-Allow-Origin' header is present on the requested resource

    Which was a CORS problem.

    However the solutions turns out to be to use HTTPS instead of HTTP.

    Then you will have

    request : POST /formHandler -> response : 200 Ok

提交回复
热议问题