gpt4 book ai didi

http - 400 是 OAuth 验证错误 (http) 的适当错误代码吗?

转载 作者:可可西里 更新时间:2023-11-01 16:24:31 25 4
gpt4 key购买 nike

大家好:对于一个虽然格式正确但包含无效 oauth token 的请求,正确的 http 响应代码应该是什么?

错误代码 400 似乎具有误导性,因为我认为无效的 oauth 不是格式错误的请求。

奇怪的是,facebook oauth token (如果无效)的情况是,如果返回 400 响应代码,则会导致 api 返回结果......

最佳答案

来自 http://oauth.net/core/1.0a/#http_codes

HTTP 400 Bad Request
Unsupported parameter
Unsupported signature method
Missing required parameter
Duplicated OAuth Protocol Parameter
HTTP 401 Unauthorized
Invalid Consumer Key
Invalid / expired Token
Invalid signature
Invalid / used nonce

所以 401 是正确的。

关于http - 400 是 OAuth 验证错误 (http) 的适当错误代码吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8702622/

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