gpt4 book ai didi

http-get - HEAD 响应是否比 GET 更快?

转载 作者:行者123 更新时间:2023-12-02 14:42:29 24 4
gpt4 key购买 nike

我目前正在使用 GET 获取有关文件的信息,如果使用 HEAD 请求重写它会更快吗?因为我在第一次响应后关闭了连接。

最佳答案

HEAD 响应仅包含 HTTP header ,但不包含正文 - 如果正文中不使用通常在 GET 响应中传输的任何信息,则仅使用 HEAD 通常会更快 - 如果没有正文从它开始应该不会有什么不同。

同样来自here :

The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. This method can be used for obtaining metainformation about the entity implied by the request without transferring the entity-body itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification.

关于http-get - HEAD 响应是否比 GET 更快?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7132967/

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