Hypertext Transfer Protocol(HTTP) is a foundational protocol used for communication on the World Wide Web that enables the transfer of data and documents between web servers and web clients (typically web browsers), allowing users to access and interact with web content.
HTTP was developed in the early 1990s by Tim Berners-Lee, the inventor of the World Wide Web, as part of the broader set of technologies that underpin the web.
What does HTTP stand for?
Client Server Model
HTTP follows a client-server model of communication.
In this model, a client (usually a web browser) sends requests to web servers, and the servers respond with the requested resources (such as web pages, images, or files).
HTTP Response
HTTP Methods
When communicating with a web server 2 types of methods are usually used:
GET
The GET method is used to retrieve data from the server. When you make a GET request to a resource, the server sends back the requested data in the response body. GET requests should not have any side effects on the server; they should only retrieve data.
The GET method is used when loading a web page or response
POST
POST is used to submit data to be processed to a specified resource. It can be used to create new resources on the server, submit form data, or trigger other state-changing actions. POST requests can have side effects on the server.
The POST method is used when submitting a form.
What is the HTTP method used to retrieve information from a server?
Which HTTP method is used to submit data to be processed to a specified resource?
Stateless Protcol
HTTP is a stateless protocol, meaning that each request from a client to a server is independent, and the server does not retain any knowledge of previous requests from the same client.
To maintain session state, web applications often use techniques like cookies or session tokens.
In a stateless protocol, each request from a client to a server is treated as an transaction.
Cookies
Cookies are small pieces of data that websites send to a user's web browser and store on the user's computer or device.
They can be used for:
Session management - maintaining items in a shopping cart.
Personalisation - such as display language choice
Tracking - Tracking user behavior across websites
Authentication - keeping a user logged into a website
Advertisements - Used to deliver personalised adverts based on browsing behavior
HTTP cookies are used to information on a user's computer.
Tracking Cookie
HTTPS
Hypertext Transfer Protocol Secure(HTTPS) is an extension of the standard HTTP and is used for secure communication over the internet.
HTTPS provides:
encryption - data can't be read if intercepted
data integrity - data can't be tampered with
authentication - ensuring that the user is client is communicating with the intended recipient.
What does the 'S' in HTTPS indicate?
What is the main difference between HTTP and HTTPS?