Http: Difference between revisions
From wikinotes
(→Notes) |
|||
Line 54: | Line 54: | ||
</source> | </source> | ||
</blockquote><!-- Requests/Response Line --> | </blockquote><!-- Requests/Response Line --> | ||
= HTTP Cookies = | = HTTP Cookies = |
Revision as of 13:40, 18 September 2021
TODO:
clean this up
TODO:
add section for headers, CORS, Content Security Policy, etc
Documentation
MDN HTTP overview https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview http headers https://en.wikipedia.org/wiki/List_of_HTTP_header_fields
HTTP Protocol Anatomy
The HTTP protocol is composed of requests and responses. At the top of an HTTP message is a header with information about the sender (ex: operating system, character-set, ip-address, port, ...). The header is followed by the body of the message (called a resource). Resources are generally either files, or responses from server-side CGI scripts.
Skeleton of HTTP protocol:<initial line, different for request vs. response> Header1: value1 Header2: value2 Header3: value3 <optional message body goes here, like file contents or query data; it can be many lines long, or even binary data $&*%@!^$@> # source: https://www.jmarshall.com/easy/http/Request/Response Line
This is the first line in the header, and it varies slightly depending on the type of method the HTTP message is using.
request
# <method> <local path of file> <http version> GET /path/to/file/index.html HTTP/1.0response
# <http version> <status-code> <status-phrase> HTTP/1.0 200 Ok HTTP/1.0 404 Not FoundHTTP Cookies
See http cookies.
Notes
http protocol http headers http statuses http cookies