HTTP

Derek Bridge

Department of Computer Science,
University College Cork

HTTP

Aims:

The Web is a client-server application

Ports

Listening on ports

Suppose a machine is running Web server software and email server software. Then requests from clients must indicate which server software should handle the request and deliver the response. This is done by including a number, called a port, with the request: 80 for the Web, and 143 for email.

What your browser does when you enter a URL or click on a link...

HTTP requests

An HTTP request comprises a request line, one or more request header lines and a message body (often empty).

Example HTTP request from The TCP/IP Guide by Charles M. Kozierok

HTTP responses

An HTTP response comprises a status line, one or more request header lines, and a message body, which contains the Web page or stylesheet orimage, or whatever it is that is being sent back.

Example HTTP response from The TCP/IP Guide by Charles M. Kozierok

HTTP response status codes

1XX: Informational (used in 1.1):
e.g. 100 Continue, 101 Switching Protocols
2XX: Success:
e.g. 200 OK, 206 Partial Content
3XX: Redirection:
e.g. 301 Moved Permanently, 304 Not Modified
4XX: Client error:
e.g. 400 Bad Request, 403 Forbidden, 404 Not Found
5XX: Server error:
e.g. 500 Internal Server Error, 503 Service Unavailable

DNS

Embedded content