HTTP response with redirect, but without roundtrip?

前端 未结 2 1233
名媛妹妹
名媛妹妹 2021-01-13 18:28

I want the browser to reflect some other URL than the one used to create the request, but without roundtripping to the server.

I would maybe do this:



        
2条回答
  •  别那么骄傲
    2021-01-13 19:01

    No. Http is stateless, and every request has one answer. When you post, you need to redirect to a get page immediately to prevent a double post - you don't want it to sit on that post url. The redirect is what tells the browser that it is on a new page. That's just the way it works.

提交回复
热议问题