Application Layer Flashcards
Application Level Protocols may be divided into:
client-server protocols;
peer-to-protocols
What does a client-server protocol do?
In a client-server protocol, a client sends a request to a
server and receives a response back from it
how does a Hypertext Transfer Protocol (HTTP) work?
a client sends a request for a web page to a server and receives the page as a response back from it
An HTTP request consists of:
∙ the request line;
∙ the request headers;
∙ the request body.
The request line consists of:
a method, resource, and a version.
Some of the most important methods are:
GET receive data HEAD receive headers of data POST send additional data PUT send replacement data DELETE delete data
The request headers consist of :
(name, value) pairs on
separate lines:
Content-Length : 324
Some of the most important request headers are:
Host domain name of the server Cache-Control caching allowed Connection connection preferred Content-Length length of the body Cookie cookie data Date date sent User-Agent name of the client
Why might a client add the header DNT (short for Do Not Track)?
for privacy reasons
When is the request body not empty?
The request body is empty for all but POST requests.
An HTTP Response consists of:
∙ the status line;
∙ the response headers;
∙ the response body.
The status line consists of:
a version, code and a reason
Some of the most important codes and reasons are:
200 OK
301 Moved Permanently
404 Not Found
500 Internal Server Error
Some of the most important response headers are:
Header Meaning Cache-Control caching allowed Connection connection preferred Content-Length length of the body Server name of the server Set-Cookie cookie data Transfer-Encoding content-encoding used
The response body is often in what programming language?
HTML