gpt4 book ai didi

http - 什么字节范围 0- 表示

转载 作者:行者123 更新时间:2023-12-05 02:47:16 35 4
gpt4 key购买 nike

“Range: bytes=0-” header 是什么意思?是整个文件吗?我尝试发回 0 个字节但没有成功,当我发送整个文件时它可以正常工作,但我在流式上下文中不止一次收到此请求,它看起来不正确。

最佳答案

Is the entire file ?

是的,正是这样。

规范有 the grammar :

     byte-range-set  = 1#( byte-range-spec / suffix-byte-range-spec )
byte-range-spec = first-byte-pos "-" [ last-byte-pos ]

还有注释:

If the last-byte-pos value isabsent, or if the value is greater than or equal to the currentlength of the representation data, the byte range is interpreted asthe remainder of the representation

另外:

A client can request the last N bytes of the selected representationusing a suffix-byte-range-spec.

     suffix-byte-range-spec = "-" suffix-length

因此,规范中的有效示例包括:

bytes=-500
bytes=9500-
bytes=0-0,-1

I receive this request more than once in a streaming context

header 表示此客户端理解范围请求,并会接受 206 Partial Content响应,而不是整个文件,以实现高效流式传输 ( What does the HTTP 206 Partial Content status message mean and how do I fully load resources? )。

关于http - 什么字节范围 0- 表示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65063701/

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