HTTP stands for Hypertext Transfer Protocol. It's a stateless, application-layer protocol for communicating between distributed systems, and is the foundation of the modern web. As a web developer, we all must have a strong understanding of this protocol.
Let us review this protocol through the lens of a web developer. We will tackle the topic in two parts.
In this first entry, we'll cover the basics and outline the various request and response headers. In the follow-up article, we will review specific pieces of HTTP, namely caching, connection handling and authentication. It is best to instead consult the RFC (RFC 2616) for in-depth coverage. I will be pointing to specific parts of the RFC throughout the article.
HTTP allows for communication between a variety of hosts and clients, and supports a mixture of network configurations.
To make this possible, it assumes very little about a particular system, and does not keep state between different message exchanges. This makes HTTP a stateless protocol. The communication usually takes place over TCP/IP, but any reliable transport can be used. The default port for TCP/IP is 80, but other ports can also be used.
TCP/IP Protocols For the Web
Web browsers and servers use TCP/IP protocols to connect to the Internet. Common TCP/IP protocols are:
HTTP - Hyper Text Transfer Protocol: HTTP takes care of the communication between a web server and a web browser. HTTP is used for sending requests from a web client (a browser) to a web server, returning web content (web pages) from the server back to the client.
HTTPS - Secure HTTP: HTTPS takes care of secure communication between a web server and a web browser. HTTPS typically handles credit card transactions and other sensitive data.
FTP - File Transfer Protocol: FTP takes care of transmission of files between computers.