spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / programming / http / chap3 / 1 To page 1current pageTo page 3To page 4To page 5To page 6To page 7
[previous] [next]

HTTP: The Definitive Guide, Chapter 3: HTTP Messages

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

The Parts of a Message

HTTP messages are simple, formatted blocks of data. Take a peek at Figure 3-3 for an example. Each message contains either a request from a client or a response from a server. They consist of three parts: a start line describing the message, a block of headers containing attributes, and an optional body containing data.

Three parts of an HTTP message
Figure 3-3. Three parts of an HTTP message

The start line and headers are just ASCII text, broken up by lines. Each line ends with a two-character end-of-line sequence, consisting of a carriage return (ASCII 13) and a line-feed character (ASCII 10). This end-of-line sequence is written "CRLF." It is worth pointing out that while the HTTP specification for terminating lines is CRLF, robust applications also should accept just a line-feed character. Some older or broken HTTP applications do not always send both the carriage return and line feed.

The entity body or message body (or just plain "body") is simply an optional chunk of data. Unlike the start line and headers, the body can contain text or binary data or can be empty.

In the example in Figure 3-3, the headers give you a bit of information about the body. The Content-Type line tells you what the body is--in this example, it is a plain-text document. The Content-Length line tells you how big the body is; here it is a meager 19 bytes.


home / programming / http / chap3 / 1 To page 1current pageTo page 3To page 4To page 5To page 6To page 7
[previous] [next]


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS · Sending an HTML and Plain Text E-newsletter with ASP.NET, Part 2
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
ANSI SQL Hierarchical Data Processing Basics · Top 10 Threats to Wireless Security · Nuvio Intros NuvioFlex Virtual PBX

Created: January 13, 2003
Revised: January 13, 2003

URL: http://webreference.com/programming/http/chap3/1/2.html