【问题标题】:Should HEAD's response status code be the same as GET's status code?HEAD 的响应状态码应该和 GET 的状态码一样吗?
【发布时间】:2018-11-14 22:08:33
【问题描述】:

据我所知,HEADGET 相同,但没有响应正文。如果我请求的资源不存在,GET 将响应 404 Not Found。在这种情况下应该返回什么状态码 HEAD 请求? 200 OK 还是 404 Not Found

【问题讨论】:

标签: http http-get http-status-codes http-method http-head


【解决方案1】:

正如你自己所说,响应应该是相同的除了没有正文。

这意味着状态和标头都需要与GET 请求相同。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-23
    • 1970-01-01
    • 2016-01-18
    • 1970-01-01
    • 1970-01-01
    • 2020-09-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多