gpt4 book ai didi

http - HTTP 501 是否适用于未实现的 API?

转载 作者:可可西里 更新时间:2023-11-01 15:13:21 25 4
gpt4 key购买 nike

HTTP 501 错误是否适用于服务器计划支持但目前不支持的功能,例如 API 的特定情况?例如,如果我正在设计一个网络邮件应用程序,但我还不能删除带附件的电子邮件,如果我收到关于带附件的电子邮件的删除请求,是否应该给出 501?

RFC 说它应该用于未知方法(例如 PARTY 请求),但不清楚它是否也应该用于其他功能。

最佳答案

appropriate

No :

6.6.2. 501 Not Implemented

The 501 (Not Implemented) status code indicates that the server doesnot support the functionality required to fulfill the request. Thisis the appropriate response when the server does not recognize therequest method and is not capable of supporting it for any resource.

Use 405 :

6.5.5. 405 Method Not Allowed

The 405 (Method Not Allowed) status code indicates that the methodreceived in the request-line is known by the origin server but notsupported by the target resource. The origin server MUST generate anAllow header field in a 405 response containing a list of the targetresource's currently supported methods.

关于http - HTTP 501 是否适用于未实现的 API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32889983/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com