`
`MEmanning@cowrncroisemeworo
`
`Covers HTTP/1.1
`
`Facebook's Exhibit No. 1015/1115
`Page 1
`
`Facebook's Exhibit No. 1015/1115
`Page 1
`
`
`
`Illustrated Guide
`toliP
`
`
`
`PAUL S. HETHMON
`ee
`
`MANNING
`
`Greenwich
`
`(74° w. long.)
`
`Facebook's Exhibit No. 1015/1115
`Page 2
`
`Facebook's Exhibit No. 1015/1115
`Page 2
`
`
`
`Forelectronic browsing and ordering ofthis book, see http://www.browsebooks.com.
`
`The publisher offers discounts on this book when ordered in quantity. For more
`information, please contact:
`
`QA 76
`rane
`"HPEH £EY
`yIFT
`MRC
`
`Special Sales Department
`;
`ty
`S
`Manning Publications Co.
`3 Lewis Street
`Greenwich, CT 06830
`
`Fax: (203) 661-9018
`email: orders®manning.com
`
`on
`ee.
`ck "
`MAY 08.1997
`
`
`
`©1997 by ManningPublications Co.All rights reserved.
`
`Nopart ofthis publication may be reproduced,stored in a retrieval system, or
`transmitted,in any form or by meanselectronic, mechanical, photocopying, ot
`otherwise, withoutprior written permission of the publisher.
`
`© Recognizing the importance ofpreserving whathas been written,it is
`Manning's policy to have the books it publishes printed on acid-free paper, and
`we exert our best efforts to that end.
`
`Manyofthe designations used by manufacturers andsellers to distinguish their
`productsare claimed as trademarks. Where those designations appear in the book,
`and Manning Publications was aware ofa trademark claim, the designations have
`been printed ininitial caps orall caps.
`
`Library of Congress Cataloging-in-Publication Data
`Hethmon, Paul S.
`Illustrated guide to HTTP / Paul S. Hethmon.
`p-
`cm.
`Includes bibliographical refrences and index.
`ISBN 1-884777-37-6
`1. Hypertext systems. 2. HTTP (Computer network protocol)
`1. Tide,
`QA76.76.H94H484_ 1997
`004.6'2—de21
`
`97-1596
`cIP
`
`iM Manning Publications Co.
`3 Lewis Street
`Greenwich, CT 06830
`
`Copyeditor: Maggie Mitchell
`Typesetter: Dorothy Marsico
`Cover designer: Leslie Haimes
`
`Printed in the United States of America
`123456789 10 —~ CR — 00 99 98 97
`
`Facebook's Exhibit No. 1015/1115
`Page 3
`
`Facebook's Exhibit No. 1015/1115
`Page 3
`
`
`
`contents
`
`
`
`XU
`preface
`acknowledgments—xiv
`
`1
`
`Introduction 1
`
`Is this book for you? 2
`1.1
`1.2. Required background 3
`1.3. The material 4
`1.4 Finishing 6
`
`2 HTTP overview 7
`
`2.1 What is the World Wide Web? 8
`Theclient/server model 8
`
`2.2 General operation 10
`2.3 Abit of history 12
`HTTP/0.9 12, HTTP/1.0 13
`
`Persistent connections 18,
`
`2.4 HTTP/1.1 16
`Newrequest methods 17,
`Chunked encoding 19, Byte range operations 20,
`Contentnegotiation 20, Digest Authentication 21,
`Caching 22
`2.5 Finishing 24
`
`vil
`
`Facebook's Exhibit No. 1015/1115
`Page 4
`
`Facebook's Exhibit No. 1015/1115
`Page 4
`
`
`
`CONTENTS
`
`
`3 Basic HTTP—syntax and semantics 25
`3.1 Terminology 26
`3.2 Protocol syntax 31
`3.3 The basic grammar 33
`3.4 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
`3.5 Finishing 52
`
`4
`
`The request 53
`4.1 The Request Message 54
`4.2 Methoddefinitions 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
`
`4.3 The request headerfields 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,
`IfMatch 68,
`If-None-Match 68,
`If-Range 69,
`IfUnmodified-Since 69, Max-Forwards 69,
`Proxy-Authorization 70, Range 70, Referer 71,
`User-Agent 71
`4.4 Implementation 71
`GET and HEAD 72, POST 78, PUT 80,
`DELETE 81, OPTIONS 81, TRACE 82
`4.5 Finishing 83
`
`vill
`
`Facebook's Exhibit No. 1015/1115
`Page 5
`
`Facebook's Exhibit No. 1015/1115
`Page 5
`
`
`
`
`
`CONTENTS
`
`
`5 Entity and general headers, and cache-control 84
`5.1 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
`
`5.2 The general headers 88
`Pragma 89,
`Connection 89, Date 89,
`Transfer-Encoding 89, Upgrade 90, Via 90
`5.3. Cache-Control 91
`Whatis cachable? 93, Age 93, Cache-Control 94,
`Expires 95, Warning 95, Cache operation 96,
`Expiration of responses 99,
`Fresh andstale
`responses 100, Validating a response 101, Examples 103
`5.4 Finishing 105
`
`6 The response 106
`6.1 The response message 107
`6.2 The response headerfields 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
`
`6.3 Digest Access Authentication 117
`6.4 Implementation 121
`GETand byte range
`GET and HEAD 121,
`requests 124, GET and contentnegotiation 126
`6.5 Finishing 127
`
`Facebook's Exhibit No. 1015/1115
`Page 6
`
`Facebook's Exhibit No. 1015/1115
`Page 6
`
`
`
`CONTENTS
`
`7
`
`Sockets 128
`
`pel
`
`ag?
`
`Fo
`
`7.4
`
`7.5
`
`7.6
`
`7.7
`
`7.8
`
`1D
`
`The socket 129
`
`Setting up the server socket 130
`Setting up theclient socket 134
`Data transmission 136
`
`Utility routines 144
`Host name and address routines 144
`NTspecifics 146
`OS/2 specifics 147
`The socket class 149
`
`7.10
`
`Feu)
`
`The socket class methods 154
`Finishing 173
`
`8
`
`The HTTP/1.1 server 174
`
`8.1
`
`8.2
`
`8.3
`
`8.4
`
`8.5
`
`8.6
`
`8.7
`
`8.8
`
`8.9
`
`8.10
`
`8.11
`
`8.12
`
`8.13
`
`8.14
`
`8.15
`
`Theconfigurationfile 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
`
`GETthe document 254
`Checking the IfRange 265
`
`Facebook's Exhibit No. 1015/1115
`Page 7
`
`Facebook's Exhibit No. 1015/1115
`Page 7
`
`
`
`CONTENTS
`
`
`8.16 Transmission of byte ranges 267
`8.17 Finishing 274
`
`9 Common Gateway Interface support 275
`9.1 Basic functions 276
`9.2 Executing the CGI program 287
`9.3 The OS/2 version 289
`9.4 The Windows version 299
`
`9.5 Finishing 308
`
`appendix A HTTP syntax 309
`
`appendix B_ HTTP header-field definitions
`
`321
`
`370
`glossary
`bibliography
`index 373
`
`372
`
`Facebook's Exhibit No. 1015/1115
`Page 8
`
`Facebook's Exhibit No. 1015/1115
`Page 8
`
`