** Request ** GET/POST/HEAD localPath HTTP/x.x HEAD - send headers only POST - i.e., from web forms with Content-Type application/x-www-form-urlencoded ** Response ** HTTP/x.x code desc codes: 1xx information, 2xx success, 3xx redirect, 4xx error in client request, 5xx error in server 200 OK, 404 Not Found, 301 Moved Permanently, 302 Moved Temporarily, 303 See Other, 500 Server Error 100 Continue - required for HTTP/1.1 servers 501 Not Implemented - if method not implemented by server ** Headers ** Header-Name: value lines in header end in \r\n header-names not case sensitive after : can be more whitespace, can go across lines by having whitespace at beginning of next line Host: required in HTTP/1.1 requests User-Agent: which browser, etc. is making request Server: identifies server program (e.g., Apache) Last-Modified: hint to client for caching Content-Type: MIME-type, e.g., text/html or image/gif Content-Length: # bytes empty line at end of header, so \r\n\r\n Transfer-Encoding: chunked - allows starting to send data before knowing how long it will be Connection: close - if not keeping TCP socket open after current operation Date: - required in HTTP/1.1 If-Modified-Since, If-Unmodified-Since: - HTTP/1.1 must handle ** Chunked data ** sizeInHex; optional semicolon with stuff to ignore after, end line with \r\n data (which will be sizeInHex bytes) 0 (line with just 0) optional-footers/headers, followed by a blank line ** URL-encoding ** 1) Convert unsafe characters to %xx with xx ascii/hex value for character. Unsafe - non-printable, =, &, %, +. 2) Change spaces to pluses 3) name1=value1&name2=value2