HyperText Transfer Protocol (HTTP) is the underlying protocol used by the World Wide Web to define how messages are formatted and transmitted and what actions Web servers and browsers should take in response to various commands. It is a request-response protocol in the client-server computing model. Clients and servers communicate by exchanging individual messages. The message sent by the client, typically a Web browser, is the request while the message sent by the server as an answer is the response. The server will provide resources such as HTML files, which is which contain the information for formatting and displaying Web pages
In simpler terms, when a URL is entered into a Web browser, an HTTP command is sent to the Web server directing it to fetch and transmit the requested Web page. HTTP is a stateless protocol, meaning that the server is not required to retain session information or status about each user for the duration of multiple requests. This can become problematic for interactions with certain pages, such as using an e-commerce shopping basket. While HTTP is stateless, using HTTP cookies allows for stateful sessions.
HTTP response status codes
HTTP response status codes are issued by a server in response to a client’s request. It indicates whether a specific HTTP request has been successfully completed and helps to identify the cause of the problem. Responses are divided into five classes:
- Informational response (100-199): A response indicating the request was received and understood.
- Successful response (200-299): A response indicating the request was received, understood, and accepted.
- Redirects (300-399): A response indicating the client must take additional action to complete the request.
- Client errors (400-499): The error has been caused by the client. “404: Not Found” is a common status code. This means the server could not find the requested resource. In a browser, it means the URL is not recognized.
- Server errors (500-599): The server has failed to fulfill the request.
The first digit indicates the class of the response. The last two digits do not mean anything in terms of classification. The status code can be found within an HTTP message, which is how data is changed between a server and a client. HTTP messages are composed of textual information encoded in ASCII and span over multiple lines. There are two types of messages: requests and responses, each having its own format.
A similar abbreviation, HTTPS stands for HyperText Transfer Protocol Secure. Simply put, it is the secure version of HTTP. Communications between the browser and website (client and server) are encrypted by Transport Layer Security. Before entering sensitive information such as credit card details or a password, check that the website is using HTTPS. If it is not, any data entered into the website will be sent in plaintext, making it susceptible to interception.