Use http status 202 for asynchronous operations

后端 未结 4 846
小鲜肉
小鲜肉 2020-12-02 07:45

I am writing a REST API for a service that will accept user contributed data. I would like to keep all operations completely asynchronous, this includes PUT, POST, DELETE an

4条回答
  •  生来不讨喜
    2020-12-02 08:17

    FWIW, Microsoft Flow uses a pattern like this.
    First call returns 202 w/ Location header. Followup calls return either: 1. If still processing --> 202 w/ a location header. The loc header can be different, which provides a way to pass state between calls (and potentially make the server stateless!). 2. If done --> 200.

    Details at: https://github.com/jeffhollan/LogicAppsAsyncResponseSample

提交回复
热议问题