正在进行的HTTP状态代码? [英] HTTP status code for in progress?

查看:138
本文介绍了正在进行的HTTP状态代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的端点看起来像这样:
GET:
/ v1 / resourcebeingcreated / status

I have an endpoint that looks something like this: GET: /v1/resourcebeingcreated/status

是否有首选的HTTP状态如果此资源的加载/创建正在进行但未完成,则返回代码(超过200,并且响应正文解释正在进行中)

Is there a preferred HTTP status code to return (beyond 200 with a response body that explains "in progress") if the loading/creation of this resource is in progress but not complete?

如果不是,是在标题或响应正文中返回进行中状态的最佳方法吗?

If not, is the best way to return the "in progress" status in a header or the response body?

推荐答案


  1. http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#2xx_Success -
    没有。 :)

  2. 我认为这应该取决于你想要实现的
    。是你试图以某种方式通知第三方?如果
    你定义了自己的API,那就可以了,我想将它设置在
    的标题中。然而,一个更常见,更直观的方法是
    身体。

  1. http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#2xx_Success - no. :)
  2. I think it should depend on what you are trying to achieve. Is it that you trying to notify a third party somehow? If you are defining your own API, that would be OK I guess to set it in the header. Yet, a more common and more intuitive approach is the body.

这篇关于正在进行的HTTP状态代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆