When you browse the web, your computer is constantly talking to other computers. The language they use is called HTTP — Hypertext Transfer Protocol.
HTTP is how your browser and a server exchange information. The “verbs” of this language are called HTTP methods. They tell the server what you want to do: read data, send data, delete something, or update it.
GET
Used to request information from the server. Example: Loading your profile page. You type a web address:
https://api.example.com/users
Your browser sends a GET request to the server. The server responds with data, a webpage, or an error.
POST
Used to send data to the server, usually to create something new. Example: Signing up on a website.
How it works: You see a form like this:
…
When you browse the web, your computer is constantly talking to other computers. The language they use is called HTTP — Hypertext Transfer Protocol.
HTTP is how your browser and a server exchange information. The “verbs” of this language are called HTTP methods. They tell the server what you want to do: read data, send data, delete something, or update it.
GET
Used to request information from the server. Example: Loading your profile page. You type a web address:
https://api.example.com/users
Your browser sends a GET request to the server. The server responds with data, a webpage, or an error.
POST
Used to send data to the server, usually to create something new. Example: Signing up on a website.
How it works: You see a form like this:
<form action="/signup" method="POST">
<input name="name" placeholder="Your name" />
<input name="email" placeholder="Your email" />
<input name="password" type="password" placeholder="Your password" />
<button type="submit">Sign Up</button>
</form>
When you fill it and click sign up, your browser sends:
POST /signup HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
name=Parthiban&email=parthi@example.com&password=123456
Flask receives the request and extracts data. Flask connects to PostgreSQL and runs:
INSERT users...
PostgreSQL Insert the record and confirms.
Server Response:
HTTP/1.1 201 Created
{
"message": "User created successfully!"
}
Your browser shows: “Welcome, Parthiban!”
PUT Used to update or replace data entirely. It’s idempotent. Doing it multiple times doesn’t change the result beyond the first time.
DELETE Used to remove data. Example: Clicking “Delete my account”:
PATCH Used to make small changes to data without replacing it entirely. Partially idempotent.
Why Not Access the Database Directly? Direct access to the database is dangerous, it opens huge security risks:
- Anyone could delete all data
- View private information
- Modify things they shouldn’t That’s why we use servers as gatekeepers.
Servers as Gatekeepers Think of the server (API) as a security guard. It checks every request:
- Are you logged in?
- Do you own this data?
- Is it allowed? If yes → server updates database. If no → server sends “Unauthorized”.
Finally... Frontend — What you see (HTML, CSS, JS in browser) Backend — The brain (Node.js, Python, Java…) Database — Memory storage (MySQL, MongoDB, PostgreSQL…)