Win32:WinHttpReadData 中分块编码支持的状态如何?
WinHttpReadData 文档 说,关于 < a href="https://www.rfc-editor.org/rfc/rfc2616#section-3.6.1" rel="nofollow noreferrer">HTTP 的分块传输编码:
从 Windows Vista 和 Windows Server 2008 开始,WinHttp 使应用程序能够对发送到服务器的数据执行分块传输编码。当 WinHttp 响应中存在 Transfer-Encoding 标头时,WinHttpReadData 在将数据提供给应用程序之前会去除分块信息。
有人能破译这个吗?
Q1 首先,此文本位于 WinHttpReadData 的页面上,该页面用于...读取 HTTP 客户端应用程序中的数据,特别是响应数据。那么当它说时是什么意思
从 Windows Vista 和 Windows Server 2008 开始,WinHttp 使应用程序能够对发送到服务器的数据执行分块传输编码。
WinHttpReadData 函数不用于将数据发送到服务器。从服务器读取数据时使用它。
查阅WinHttpWriteData 函数的文档,其中用于将数据作为 HTTP 请求的一部分发送到服务器,没有提及分块传输功能。
Q2 假设我弄清楚新的分块传输支持意味着什么,我如何获得该支持? 它说它是 Vista 和 WS2008 上的新功能。如果我编写一个在 WS2003 上运行并使用 WinHttpReadData 的应用程序,并且它遇到分块响应,或者 WinHttpWriteData,并且它想要发送分块请求,会发生什么情况?
言外之意,这个文档是否说我需要链接到 Vista 时代的 Windows SDK 或更高版本中的 WinHttp.lib,以获得进行分块编码的功能?或者在 WS2003 上真的不可能吗?换句话说,使用该库进行分块传输的应用程序必须在指定的操作系统上运行?
这听起来可能像是咆哮,但事实并非如此。我真的很想知道。
The documentation for WinHttpReadData says, regarding HTTP's chunked transfer coding:
Starting in Windows Vista and Windows Server 2008, WinHttp enables applications to perform chunked transfer encoding on data sent to the server. When the Transfer-Encoding header is present on the WinHttp response, WinHttpReadData strips the chunking information before giving the data to the application.
Can anyone decipher this?
Q1 First, this text is on the page for WinHttpReadData, which is used to ... read data within an HTTP client application, specifically the response data. So what does it mean when it says
Starting in Windows Vista and Windows Server 2008, WinHttp enables applications to perform chunked transfer encoding on data sent to the server.
The WinHttpReadData function isn't used with data being sent to the server. It is used when reading data from the server.
Consulting the doc for the WinHttpWriteData function, which is used to send data to the server as part of an HTTP request, there is no mention of the chunked transfer capability.
Q2 Supposing that I figure out just what the newish chunked transfer support amounts to, how do I get that support? It says that it is new on Vista and WS2008. What happens if I write an app that runs on WS2003, and uses WinHttpReadData and it encounters a chunked response, or WinHttpWriteData, and it wants to send a chunked request?
Between the lines, is this documentation saying that I need to link against the WinHttp.lib in the Vista-era Windows SDK, or later, in order to get the capability to do chunked encoding? Or is it really impossible on WS2003?, in other words it is the case that the app doing chunked transfer using this library must run on the OS specified?
This might read like a rant, but it's not. I truly want to know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的本地副本没有它,对我来说似乎是一个错误。 本文中介绍了分块,“传输编码头”部分。它应该是透明的以便于阅读。
My local copy doesn't have it, looks like a mistake to me. Chunked is covered in this article, "Transfer encoding header" section. It should be transparent for reading.