内容范围和范围标题之间的区别? [英] Difference between Content-Range and Range headers?

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

问题描述

HTTP标头内容范围和范围有什么区别?应该何时使用?

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?

谢谢

推荐答案

在请求中使用范围,要求特定范围(或范围)的字节。在响应中使用 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).

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

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