Table of Contents
preface xii
acknowledgments xiv
1 Introduction 1
-
Is this book for you? 2
-
Required background 3
-
The material 4
-
Finishing 6
2 HTTP overview 7
-
What is the World Wide Web? 8
The client/server model 8
-
General operation 10
-
A bit of history 12
HTTP/0.9 12, HTTP/1.0 13
-
HTTP/1.1 16
New request methods 17,
Persistent connections 18,
Chunked encoding 19,
Byte range operations 20,
Content negotiation 20,
Digest Authentication 21,
Caching 22
-
Finishing 24
3 Basic HTTP--syntax and semantics 25
-
Terminology 26
-
Protocol syntax 31
-
The basic grammar 33
-
Basic HTTP concepts 34
HTTP version 34,
Uniform Resource Identifiers 35,
Formats for date and time 38,
Code: date handling 39,
Character sets 41,
Content codings 42,
Transfer codings 43,
Code: chunked encoding 44,
Media types 47,
Product tokens 49,
Quality values 49,
Language tags 50,
Entity tags 50,
Range units 51
-
Finishing 52
4 The request 53
-
The Request Message 54
-
Method definitions 55
The OPTIONS method 55,
The GET method 56,
The HEAD method 57,
The POST method 58,
The PUT method 59,
The DELETE method 60,
The TRACE method 60
-
The request header fields 61
Accept 61,
Accept-Charset 62,
Accept-Encoding 62,
Accept-Language 62,
Authorization 63,
Code: Base64 64,
From 67,
Host 67,
If-Modified-Since 67,
If-Match 68,
If-None-Match 68,
If-Range 69,
If-Unmodified-Since 69,
Max-Forwards 69,
Proxy-Authorization 70,
Range 70,
Referer 71,
User-Agent 71
-
Implementation 71
GET and HEAD 72,
POST 78,
PUT 80,
DELETE 81,
OPTIONS 81,
TRACE 82
-
Finishing 83
5 Entity and general headers, and cache-control 84
-
The entity headers 85
Allow 85,
Content-Base 85,
Content-Encoding 86,
Content-Language 86,
Content-Length 86,
Content-Location 87,
Content-MD5 87,
Content-Range 87,
Content-Type 88,
ETag 88,
Last-Modified 88
-
The general headers 88
Connection 89,
Date 89,
Pragma 89,
Transfer-Encoding 89,
Upgrade 90,
Via 90
-
Cache-Control 91
What is cachable? 93,
Age 93,
Cache-Control 94,
Expires 95,
Warning 95,
Cache operation 96,
Expiration of responses 99,
Fresh and stale responses 100,
Validating a response 101,
Examples 103
-
Finishing 105
6 The response 106
-
The response message 107
-
The response header fields 111
Accept-Ranges 112,
Authentication-info 112,
Location 113,
Proxy-Authenticate 113,
Proxy-Authenticate-info 113,
Public 113,
Retry-After 114,
Server 114,
Vary 114,
Warning 114,
WWW-Authenticate 115,
Code: Digest Access Authentication 115
-
Digest Access Authentication 117
-
Implementation 121
GET and HEAD 121,
GET and byte range requests 124,
GET and content negotiation 126
-
Finishing 127
7 Sockets 128
-
The socket 129
-
Setting up the server socket 130
-
Setting up the client socket 134
-
Data transmission 136
-
Utility routines 144
-
Host name and address routines 144
-
NT specifics 146
-
OS/2 specifics 147
-
The socket class 149
-
The socket class methods 154
-
Finishing 173
8 The HTTP/1.1 server 174
-
The configuration file 175
-
The main program 179
-
The server 183
-
The authorization model 187
-
Request and response headers 189
-
HTTP/1.1 216
-
Finding the method 224
-
TRACE 225
-
OPTIONS 229
-
PUT 230
-
If functions 238
-
Chunked encoding 242
-
The DELETE method 247
-
GET the document 254
-
Checking the If-Range 265
-
Transmission of byte ranges 267
-
Finishing 274
9 Common Gateway Interface support 275
-
Basic functions 276
-
Executing the CGI program 287
-
The OS/2 version 289
-
The Windows version 299
-
Finishing 308
appendix A HTTP syntax 309
appendix B HTTP header-field definitions 321
glossary 370
bibliography 372
index 373