Web Architecture Flashcards
Which layers do these fall into?
FTP, UDP, IP, Ethernet, TCP, SMTP
FTP - Application UDP - Transport IP - Network TCP - Transport Ethernet - Network Interface SMTP - Application
What must HTTP provide?
- A subset of the file transfer functionality
- The ability to request an index search
- Automatic format negotiation
- The ability to refer the client to another server
4 properties of HTTP:
- HTTP is an application-level protocol
- HTTP is a request-response protocol
- HTTP is a synchronous protocol
- HTTP is a stateless protocol
URL and URI
URL - Used to uniquely identify a resource over the web
URI - String of characters that unambiguously identifies a particular resource
URL is a subset of URI
What is in a HTTP request
- Request Line
- Header
- Empty line
- Message Body
Main http methods?
GET Get resource from the server
POST Used to post the data up to the Web server
HEAD Get the header that a GET request would have obtained
PUT Ask the server to store the data
DELETE Ask the server to delete the data
3 properties of a http request line?
- Request Method
- Resource
- Protocol Version
What did the HTTP updates add?
HTTP 0.9 • Only GET method HTTP 1.0 • Adds HEAD and POST • Separate connection to the same server is made for every resource request HTTP 1.1 • Adds OPTIONS, PUT, DELETE, TRACE, and CONNECT • Can reuse a connection multiple times! HTTP 2.0 • Allows the server to "push" content. • respond with data for more queries than the client requested HTTP 3.0 • Faster Connection time • Runs over UDP
What is a HTTP header?
Colon-separated key-value pairs
Terminated by a carriage return (CR) and line feed (LF) character sequence
What are the HTTP request headers?
Host Accept Content-Type Cookie User-Agent
What does a HTTP header empty line mean?
Must consist of only
Must not contain other whitespace
What does a HTTP request message body contain?
- Optional
* Useful for post and put
What are the HTTP response parts?
- Status Line
- Header
- Empty line
- Message Body
What is a response status line?
Contains:
• Version
• Status Code
What are the categories of HTTP status codes
1xx informational response 2xx successful 3xx redirection 4xx client error 5xx server error
Examples of HTTP response headers?
Age Date Server Last-Modified Content-Length Content-Type
What is the HTTP response message body?
- Contains the actual data
* May be HTML but also other data
Summarise HTTP
1) User issues URL from a browser
2) Browser sends a request message
3) Server maps URL to a file or program under the document directory
4) Server returns a response message
5) Browser formats the response and displays