gpt4 book ai didi

c++ - 使用 WinHttp 函数检索 HTTP 文件的时间戳

转载 作者:行者123 更新时间:2023-11-28 02:37:52 25 4
gpt4 key购买 nike

如何使用 HTTP 协议(protocol)获取可以从 HTTP 服务器下载的文件的时间戳?我对WinHttp functions特别感兴趣,但任何 HTTP 引用都可以。

响应头中有一个时间戳字段,但它指的是 HTTP 服务器响应的时间,而不是文件的文件时间。

最佳答案

要检索通过 HTTP 接收的文件的创建/修改日期时间,在 HTTP 响应 header 中存在一个字段 Last-Modified

正如文档所说:

The Last-Modified entity-header field indicates the date and time at which the origin server believes the variant was last modified [...] The exact meaning of this header field depends on the implementation of the origin server and the nature of the original resource. For files, it may be just the file system last-modified time

检索 header 信息的 WinHttp 函数是 WinHttpQueryHeaders .

关于c++ - 使用 WinHttp 函数检索 HTTP 文件的时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26925039/

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