Content-Range 和 Range 标头之间的区别? [英] Difference between Content-Range and Range headers?

查看:41
本文介绍了Content-Range 和 Range 标头之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTTP 标头 Content-Range 和 Range 有什么区别?什么时候应该使用?

What is the difference between HTTP headers Content-Range and Range? When should each be used?

我正在尝试从特定字节偏移量流式传输音频文件.我应该使用 Content-Range 还是 Range 标头?

I am trying to stream an audio file from a particular byte offset. Should I use Content-Range or Range header?

谢谢

推荐答案

Range 用于请求中,用于请求特定范围(或范围)的字节.Content-Range 用于响应中,以指示服务器提供给您的字节数(可能与您请求的范围不同),以及整个内容的长度(如果知道).

Range is used in the request, to ask for a particular range (or ranges) of bytes. Content-Range is used in the response, to indicate which bytes the server is giving you (which may be different than the range you requested), as well as how long the entire content is (if known).

这篇关于Content-Range 和 Range 标头之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆