gpt4 book ai didi

HTTP 多范围请求 - 响应中的 header

转载 作者:可可西里 更新时间:2023-11-01 16:42:17 27 4
gpt4 key购买 nike

我正在使用这样的多范围 http 请求“curl --range 1-2,2-3 http://some.url”响应就像

--00000000000000030705 Content-Type: text/html; charset=utf-8 Content-Range: bytes 1-2/13882393

il --00000000000000030705 Content-Type: text/html; charset=utf-8 Content-Range: bytes 2-3/13882393

le --00000000000000030705--

如何从响应中删除字段 Content-Type 和 Content-Range 以从服务器获取原始数据(无需在客户端解析)?我想得到这样的回应:“伊尔”

非常感谢!

最佳答案

你可能做不到。服务器符合规范,如所述 by the RFC .

If multiple parts are being transferred, the server generating the 206 response must generate a "multipart/byteranges" payload, as defined in Appendix A, and a Content-Type header field containing the multipart/byteranges media type and its required boundary parameter. To avoid confusion with single-part responses, a server must not generate a Content-Range header field in the HTTP header section of a multiple part response (this field will be sent in each part instead).

在连续多范围的情况下,服务器可能会发送没有多部分边界的响应,但这是可选的。

When multiple ranges are requested, a server may coalesce any of the ranges that overlap, or that are separated by a gap that is smaller than the overhead of sending multiple parts, regardless of the order in which the corresponding byte-range-spec appeared in the received Range header field. Since the typical overhead between parts of a multipart/byteranges payload is around 80 bytes, depending on the selected representation's media type and the chosen boundary parameter length, it can be less efficient to transfer many small disjoint parts than it is to transfer the entire selected representation.

在多部分有效负载中每个正文部分的 header 区域内,服务器必须生成一个 Content-Range header 字段,该字段对应于该正文部分中包含的范围。如果所选表示在 200 (OK) 响应中具有 Content-Type header 字段,则服务器应在每个正文部分的 header 区域中生成相同的 Content-Type 字段。例如:

假设您的服务器符合规范,发送单个范围 1-3 您将得到一个主体。

关于HTTP 多范围请求 - 响应中的 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28738753/

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