对于 202 代码后未就绪的资源,REST 应返回什么 HTTP 代码?
似乎无法在任何地方找到这个问题的答案。有一个服务,当发布某些内容时,它会排队等待处理,响应代码为 202。标准说提供一个指向状态监视器的指针,我已经这样做了,但是如果客户端转到在资源准备好之前资源?我认为404除了资源存在之外,只是还没有被处理。
想法?
Can't seem to find the answer to this question anywhere. Have a service that when something is posted, it gets queued to be processed with a response code of 202. The standard says to provide a pointer to a status monitor, which I have done, but what should I return if the client goes to the resource before the resource is ready? I would think 404 except that the resource exists, just hasn't been processed yet.
Thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查此帖子:
对我来说似乎相对合理,除了
Location
标头 IMO 并不特别适合这个确切的目的。Check this post:
Seems relatively reasonable to me, except that
Location
header IMO is not particularly suited for this exact purpose.