Skip to content

Commit

Permalink
Fix a typo
Browse files Browse the repository at this point in the history
  • Loading branch information
raindev committed Mar 19, 2024
1 parent d766410 commit 6c26926
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/blog/http-content-and-transfer-encoding.md
Expand Up @@ -5,7 +5,7 @@ date = 2024-03-19

An HTTP message comprises a request line (a request method, an URL and a protocol version) or status line (a protocol version and a response status code) followed by a list of headers and a message body separated with an empty line. The request/status line and the headers are plain text, while the message body can be any content (specified by `Content-Type`), including binary, optionally encoded.

How the message body is encoded is described by one of two mutually exclusive headers: `Transfer-Encoding` and `Content-Encoding`. Compression and chunked transfer encoding are two main reasons behind encoding the message body. The goal of compression is to improve the performance by reducing the amount of data transferred, although it does impose additional work for the server and the client. With chunked transfer coding a large message body is broken down into into chunks transferred separately. This enables piece by piece data transfer, sending messages where the size is not known ahead of time and streaming of large media.
How the message body is encoded is described by one of two mutually exclusive headers: `Transfer-Encoding` and `Content-Encoding`. Compression and chunked transfer encoding are two main reasons behind encoding the message body. The goal of compression is to improve the performance by reducing the amount of data transferred, although it does impose additional work for the server and the client. With chunked transfer coding a large message body is broken down into chunks transferred separately. This enables piece by piece data transfer, sending messages where the size is not known ahead of time and streaming of large media.

Although the HTTP specification permits the use of compression with either of the headers, in practice the only widely supported option of `Transfer-Encoding` is `chunked` while compression is implemented using `Content-Encoding` header.

Expand Down

0 comments on commit 6c26926

Please sign in to comment.