HTTP下载究竟是什么意思? [英] What does HTTP download exactly mean?

查看:557
本文介绍了HTTP下载究竟是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常听到有人说使用HTTP 下载。这在技术上是什么意思?



HTTP代表Hyper 文本传输协议。所以要从字面上理解它,这意味着文本传输。我使用一些嗅探器工具来监控线路流量。传输的是所有ASCII字符。所以我想我们必须将我们想要下载的东西转换成字符,然后再通过HTTP传输。使用HTTP URL编码?或一些二进制到文本编码模式,如base64?但是这需要在客户端进行一些解码。



我一直认为是可以传输任何数据的TCP,所以我猜测HTTP下载是一个错误的使用的单词。这是因为我们通过HTTP查看网页,并在该页面上找到一些可下载的链接,然后点击它来下载。其实浏览器打开一个TCP连接来下载它。

解决方案

任何人都可以散发光线完整的答案 HTTP下载是什么意思?是在其RCF 2616规范中,您可以在这里阅读: http://tools.ietf.org/html/rfc2616



当然这是一个很长的(但非常详细的)文档



我不会在这里复制或总结其内容。



在您的问题正文中更具体地说:所以要从字面上理解它是用于文本传送。



我认为TEXT这个词会误导你。 / p>

必须将我们要下载的任何内容转换为字符,然后通过HTTP 传送是 false 。您不一定需要。



可以通过电线发送文件,例如JPEG图像,无需任何类型的编码。参见例如:当Web服务器返回JPEG图像(mime type image / jpeg)时,如何编码?



请注意,可选的压缩或编码(最常见的情况是GZIP为文本内容,如html,文本,脚本...),但这取决于客户端和服务器如何同意数据如何传输。该协议是分别在请求和响应头部中的Accept-Encoding和Content-Encoding指令进行的。


I often hear people say download with HTTP. What does it really mean technically?

HTTP stands for Hyper Text Transfer Protocol. So to understand it literally, it is meant for text transferring. And I used some sniffer tool to monitor the wire traffic. What get transferred are all ASCII characters. So I guess we have to convert whatever we want to download into characters before transferring it via HTTP. Using HTTP URL encoding? or some binary-to-text encoding schema such as base64? But that requires some decoding on the client side.

I always think it is TCP that can transfer whatever data, so I am guessing HTTP download is a mis-used word. It arise because we view a web page via HTTP and find some downloadable link on that page, and then we click it to download. In fact, browser open a TCP connection to download it. Nothing about HTTP.

Anyone could shed some light?

解决方案

The complete answer to What does HTTP download exactly mean? is in its RCF 2616 specification, that you can read here: http://tools.ietf.org/html/rfc2616

Of course that's a long (but very detailed) document.

I won't replicate or summarize its content here.

In the body of your question you are more specific: So to understand it literally, it is meant for text transferring.

I think the word "TEXT" it misleading you.

And have to convert whatever we want to download into characters before transferring it via HTTP is false. You don't necessarily have to.

A file, for example a JPEG image, may be sent over the wire without any kind of encoding. See for example this: When a web server returns a JPEG image (mime type image/jpeg), how is that encoded?

Note that optionally a compression or encoding may be applied (the most common case is GZIP for textual content like html, text, scripts...) but that depends on how the client and the server agree on how the data have to be transferred. That "agreement" is made with the "Accept-Encoding" and "Content-Encoding" directives in respectively the request's and the resonse's headers.

这篇关于HTTP下载究竟是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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