HTTP Messages Flashcards
What is a client?
program or device that requests data or service
What is a server?
program or device that receives requests and provides of data or service
Which HTTP method does a browser issue to a web server when you visit a URL?
HTTP GET request
What are the formats of HTTP Requests and Responses?
- start-line - describes the requests to be implemented (or its status of whether successful or failure)
- optional set of HTTP headers specifying request (or describing body including in the message)
- blank line to indicate that all meta-info for request has been sent
- optional body containing data associated with the request (or the document associated with a response
What is on the first line of an HTTP request message?
A single start-line describing the requests to be implemented.
- HTTP method, verb (GET, PUT, POST) or noun (HEAD, OPTIONS) describes the action to be performed
- request target (URL) or absolute path
- HTTP version
What is on the first line of an HTTP response message?
Its status of whether successful or a failure. This start-line is always a single line.
- The protocol version, usually HTTP/1.1.
- A status code, indicating success or failure of the request. Common status codes are 200, 404, or 302
- A status text. A brief, purely informational, textual description of the status code to help a human understand the HTTP message.
What are HTTP headers?
They specify the request, or describe the body included in the message.
- Metadata about requests and responses
Is a body required for a valid HTTP message?
Optional