使用什么httpstatuscode? [英] What httpstatuscode to use?

查看:68
本文介绍了使用什么httpstatuscode?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

QQ:

如果90%的请求获得(202)接受但奇怪的请求需要更多信息,我返回的httpstatuscode是什么发出此信号?



IE:



QQ:
If 90% of requests get a (202) Accepted but the odd one requires some more information, what httpstatuscode I return to signal this?

I.E.:

request:
POST (host/sale/endpoint)
Sales data

response: 202













POST (host/sale/endpoint)
Sales data


response: ??
We need to know the collection date





^糟糕的例子,但你明白了这个想法



这个问题是在某些情况下我们需要开始处理订单以便首先解决问题。



so什么状态代码说感谢您提供此信息,我们可以在完成最后一次请求之前获得更多信息吗?



我确定没有硬规则,但只要你可以证明你的选择,我可以尝试向我的团队证明这一点^ _ ^



谢谢

Andy



我尝试了什么:



我查看了十进制响应但不确定会有什么影响。我们可以完全控制客户端,因此我们可以根据需要添加自定义状态代码。



^ bad example but you get the idea

This issue is that in some cases we need to start processing the order so as to hit the issue in the first place.

so what status code says "Thanks for this info, can we have a bit more before completing that last request, please"?

I'm sure there's no hard rule, but as long as you can justify your choice, I can try to justify it to my team ^_^

Thanks
Andy

What I have tried:

I looked at decimal responses but not sure what that would affect. We do have full control over the clients so we could add a custom status code if we needed.

推荐答案

我是使用已经使用的代码的主要支持者在那里。



在您的情况下感谢您提供此信息,我们可以在完成最后一次请求之前获得更多信息,请,我倾向于使用IIS扩展代码:



449重试:服务器无法满足请求,因为用户没有提供所需信息
I'm a big proponent of using the codes that are already out there.

In your case "Thanks for this info, can we have a bit more before completing that last request, please", I would be inclined to use an IIS extended code:

449 Retry With: The server cannot honour the request because the user has not provided the required information


这篇关于使用什么httpstatuscode?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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