HTTP statuscode to retry same request

后端 未结 2 1844
广开言路
广开言路 2021-02-02 08:32

Is there an HTTP status code to instruct a client to perform the same request again?

I am facing a situation where the server has to \"wait\" for a lock to disappear wh

2条回答
  •  忘掉有多难
    2021-02-02 09:25

    Use the 307 redirect, but add a retry counter:

    http://path/to/server?retry=3
    

    This will make the URL different on each retry, preventing loop detection. And the server could check for retry hitting a limit, and abort with an error when that happens, so the user doesn't wait forever.

提交回复
热议问题