What does downloading HTTP exactly mean?

I often hear people say download using HTTP . What does this really mean technically?

HTTP stands for Hypertext Transfer Protocol. Therefore, to understand it literally, it is intended to convey text . And I used a sniffer tool to monitor wired traffic. All ASCII characters are transmitted. Therefore, I think we need to convert everything that we want to download to characters before transmitting it via HTTP. Using HTTP URL encoding? or some binary coding schemes like base64? But this requires some client side decoding.

I always think that TCP can transmit any kind of data, so I assume that HTTP loading is a misused word. This is due to the fact that we browse the web page via HTTP and find some kind of downloadable link on this page, and then click it to download. In fact, the browser opens a TCP connection to download it. Nothing about HTTP.

Can anyone shed some light?

+1
source share
7 answers

Full answer What the HTTP download loads means: is in the RCF 2616 specification, which you can read here: http://tools.ietf.org/html/rfc2616

Of course, this is a long (but very detailed) document.

I will not replicate or summarize its content here.

In the body of your question, you are more specifically:

To understand it literally, it is intended to convey text.

I think the word "TEXT" is misleading.

and

we need to convert everything that we want to download into characters before transmitting via HTTP

false You do not have to.

A file, such as a JPEG image, can be sent via cable without any encoding. See For example: When a web server returns a JPEG image (mime type image / jpeg), how is it encoded?

Please note that compression or encoding can be applied if necessary (the most common case is GZIP for text content such as html, text, scripts ...), but this depends on how the client and server agree on how the data should be transmitted. This "agreement" is made with the "Accept-Encoding" and "Content-Encoding" directives in the request and response headers, respectively.

+12
source

I understand that this is misleading, but if you read the Hypertext Transfer Protocol as a transfer protocol with Hypertext capabilities, it will change a little.

When HTTP was developed, there were already many protocols (for example, the IP protocol, which is widespread among servers on the Internet), but there were no protocols that made it easy to move between documents.

HTTP is a protocol that allows the transmission of AND information for hypertext (i.e. links) embedded in text documents. These links do not have to point to other text documents, so you can basically transfer any information using HTTP (the sender and receiver agree on the type of document being sent using what is called the mime type).

That way, the name still makes sense, even if you can send files other than text files.

+3
source

HTTP is a hypertext transfer protocol. Therefore, to understand this literally, it is intended to convey text.

Yes, text transmission. Not necessarily plain text , but all text. This does not mean that your text should be readable by a person, just a computer.

And I used a sniffer tool to monitor wired traffic. All ASCII characters are transmitted.

Your sniffer tool knows that you are human, so it will not just present you 0 and 1. It will convert everything that falls into ASCII characters to make it readable. All cable communications are binary. The ASCII view is just for you.

So, I think we need to convert everything we want to download to characters before passing over HTTP

No, absolutely not. Again, text is not necessarily plain text.

I always think that TCP can transmit any data, [...]

You are right here. TCP transfers all data, but at a completely different level. To understand this, let's look at the OSI model :

OSI Model

When you send something over the network, your data goes through all the different levels. First, the application level. Here we have HTTP and several others. Everything that you send via HTTP goes through layers, right up to the presentation and right up to the physical layer.

So, when you say that TCP transmits data, then you are right (HTTP can work on other transport protocols, such as UDP, but this is rare), but TCP transmits all your data, whether you upload a file from a web server, copy a shared folder on the local network between computers or send an email.

+1
source

HTTP can transmit binary data just fine. No need to convert anything.

0
source

HTTP is the protocol used to transfer your data. In your case, the file you are downloading.

0
source

You can either do this (open another type of connection) or send your data as source text. What you send is what you see when you open the file in a text editor. Your browser simply decides to save the file in the Downloads folder (or whether you want it) because it sees that the file type is not supported (.rar, .zip).

0
source

If you look at the OSI model , HTTP is a protocol that lives on the application layer. Therefore, when you hear that someone uses "HTTP for data transfer", they refer to the application layer protocol. An alternative could be, for example, FTP or NFS.

The browser does open a TCP connection when using HTTP. TCP lives in the transport layer and provides a reliable connection over IP.

The HTTP protocol provides various verbs that can be used to retrieve and send data, GET and POST are the most common. Search REST .

0
source

Source: https://habr.com/ru/post/1433183/


All Articles