Title: HTTP messages Entities and Encoding
1HTTP messagesEntities and Encoding
2Outline
- The format and behavior of HTTP message entities
as HTTP containers - How HTTP describes the size of entity bodies, and
what HTTP requires in the way of sizing - The entity headers used to describe the format,
alphabet, and language of content, so clients can
process it p
3Message Are Crates,Entities Are Cargo
HTTP/1.0 200 OK Server Netscape_Enterprise/3.6 Da
te Sun, 17 Sep 2000 000105 GMT Content_type
text/plain Content-length 18 Hi!Im a message!
Entity headers
Entity
Entity body
4Entity Bodies
5Common media types
6Content Encoding
Content-encoded content Content-Type
text/html Content-Length 7571 content-encoding
gzip
Original content Content-Type text/html Content-L
ength 7571
Original content Content-Type text/html Content-L
ength 7571
01110001 00110010
Gzip content decoder
Gzip content encoder
7Content-encoding tokens
- Content-encoding value
- gzip
- compress
- deflate
- identity
8Accept-Encoding Headers
Request message
GET /logo.gif HTTP/1.1 Accept-encoding gzip
client
server
HTTP/1.1 200 OK Content-type image/gif Content-en
coding gzip
Response message
00101101
00101101
The server compresses the image with gzip to
transport a smaller file over the thin Network
connection between itself and the client.This
saves network bandwidth And reduces the amount of
time that the client waits for the
transfer.Though,the Client will have to spend
time decompressing the image once the image is
served.
9Transfer Encoding and Chunked Encoding
Content-encoded response
Normal header block
Normal entity (just encoded)
A content-encoded message just encodes the
entity Section of the message. With
Transfer-encoded Messages the encoding is a
function of the entire Message, changing the
structure of the message itself
Transfer-encoded response
Basic header
Encoded blocks
10Chunked Encoding
11Combining Content and Transfer Encodings
Content-type text/heml
Content encoding
Content-Type text/html content-encoding gzip
9BF2578EA4 2670CD
9BF2578EA4 2670CD
Transfer encoding (chunking)
Content-Type text/html content-encoding
gzip Transfer-encoding chunked
426
426
8EA
8EA
257
257
98B
98B
12Time-Varying Instances
13Cach-Control header directives
14Cach-Control header directives
15Conditional request types
16Range Requests
Request message
GET /bigfile.html HTTP/1.1
client
Response message
HTTP/1.1 200 OK Content-Type text/html Content-Le
ngth 65537 Accept-Ranges bytes
www.csie.ncnu.edu.tw
110100 111001 101001 110010
Range request message
GET /bigfile.html HTTP/1.1 Range bytes20224-
Range response message
HTTP/1.1 200 OK Content-Type text/html Range
bytes20224- Accept-Ranges bytes
The clients original request was Interrupted,but
a second request For the part of the message that
Was not received allows the Client to resume
form the point Of the interruption
www.csie.ncnu.edu.tw
17Delta Encoding
18Delta Encoding
19Delta-encoding headers
- Etag
- If-None-Match
- A-IM
- IM
- Delta-Base
20IANA registered types of instance manipulations
21For More Information
- http//www.ietf.org/rfc/rfc2616.txt
- Hypertext Transfer Protocol -- HTTP/1.1
- http//www.ietf.org/rfc/rfc3229.txt
- Delta encoding in HTTP
- http//www.ietf.org/rfc/rfc1521.txt
- MIME (Multipurpose Internet Mail Extensions) Part
OneMechanisms for Specifying and Describing the
Format of Internet Message Bodies - http//www.ietf.org/rfc/rfc2045.txt
- Multipurpose Internet Mail Extensions(MIME) Part
OneFormat of Internet Message Bodies - http//www.ietf.org/rfc/rfc1864.txt
- The Content-MD5 Header Field
- http//www.ietf.org/rfc/rfc3230.txt
- Instance Digests in HTTP