HTTP stands for HyperText Transfer Protocol
It is the foundation of communication on the web π
In simple words
HTTP defines
how a client and server talk to each other π§
Without HTTP β
β’ No websites
β’ No APIs
β’ No data exchange
π How HTTP Works
Client sends a request π€
Server processes the request π₯οΈ
Server sends a response π©
This request response cycle
Happens every time you open a website π
π¦ Common HTTP Methods
β’ GET - fetch data π
β’ POST - send data β
β’ PUT - update data βοΈ
β’ DELETE - remove data ποΈ
π Real World Examples
β’ Opening a web page
β’ Submitting a login form
β’ Fetching data from an API
β’ Deleting a record
π» Example: Simple HTTP Request using Fetch
fetch("https://api.example.com/users")
.then(res => res.json())
.then(data => console.log(data));