# HTTP Methods: GET vs POST

> What GET, POST, PUT, PATCH and DELETE each ask a server to do. Where the data goes, in a query parameter or in the request body.

**Course:** [Computer Networking](https://learn.benibix.com/learn/infrastructure-networking)  
**Time:** 12 min

**After this lesson you can:**

- Pick the right method for a job
- Tell PUT from PATCH
- Say when data goes in the query or the body

## What each HTTP method asks for

The method is the first word of an HTTP request, and it says what to do. There are five common ones. GET reads. POST adds something new. PUT replaces a thing whole. PATCH changes part of it. DELETE removes it. The same address can take all five and do something different each time.

GET only reads and changes nothing. That makes it safe to repeat, to save as a bookmark and to keep a copy of. Opening a page, loading an image and searching a shop are all GET requests.

POST sends new data to be added. Placing an order, posting a comment and signing up are POST requests. Sending the same POST twice can make two orders. That is why a browser warns you before it sends a form again.

PUT and PATCH both change a thing that exists. PUT sends the whole new version and replaces the old one. PATCH sends only the fields that change. Sending a PUT with one field missing can wipe that field out.

Data rides in one of two places. A query parameter sits in the address after a question mark, such as ?page=2. It suits short facts for reading, such as a search word or a page number. The request body sits after the headers and suits larger data or anything private, such as a form.

Addresses get saved in browser history, in server logs and in links people share. So anything after the question mark should be safe for others to see. A password or a card number always goes in the body of a POST. It never goes in the address.

A common mistake is to use GET for something that changes data, such as a link that deletes an item. Browsers and tools fetch GET links ahead of time to make pages faster. One of them can follow that link. The item is gone with no one clicking anything.

## The five common methods

| Method | What it does | Has a body | Safe to repeat |
| --- | --- | --- | --- |
| GET | Reads a thing | No | Yes |
| POST | Adds a new thing | Yes | No, it may add two |
| PUT | Replaces a thing whole | Yes | Yes |
| PATCH | Changes part of a thing | Yes | Not always |
| DELETE | Removes a thing | Usually not | Yes |

## Which one to use

1. **Use GET.** When you only read, such as opening a page or running a search.
2. **Use POST.** When you make something new, such as an order, a comment or an account.
3. **Use PUT.** When you send the whole new version of a thing to replace the old one.
4. **Use PATCH.** When you change one or two fields and leave the rest alone.
5. **Use DELETE.** When you remove a thing, such as a saved address or an old post.

![Five method labels on the left, each with its job: GET reads order 7 and changes nothing, POST makes a new order sent to /orders, PUT replaces all of order 7, PATCH changes one part of order 7, DELETE removes order 7. Arrows from all five point to one box on the right marked /orders/7, one thing on the server.](https://learn.benibix.com/diagrams/infc-http-methods.svg)

### Example: A shop's search and checkout

A customer searches the shop for blue mugs. The browser sends GET /search?q=blue+mugs. The search word rides in the address, so the result page can be bookmarked.

At checkout, the browser sends POST /orders. The address, card details and two mugs go in the request body, where they never show up in history.

**Words in this lesson:** [HTTP Method](https://learn.benibix.com/term/infrastructure/http-method), [GET Request](https://learn.benibix.com/term/infrastructure/get-request), [POST Request](https://learn.benibix.com/term/infrastructure/post-request), [PUT Request](https://learn.benibix.com/term/infrastructure/put-request), [PATCH Request](https://learn.benibix.com/term/infrastructure/patch-request), [DELETE Request](https://learn.benibix.com/term/infrastructure/delete-request), [Query Parameter](https://learn.benibix.com/term/infrastructure/query-parameter), [Request Body](https://learn.benibix.com/term/infrastructure/request-body)

> **The one difference.** GET reads and changes nothing, so it is safe to repeat. POST adds something new, so sending it twice can add it twice.

**Question:** Where should a password go in an HTTP request?

**Answer:** In the body of a POST request. Addresses end up in history, logs and shared links. The body of a POST is not saved in those places, so private data belongs there.

---

Source: https://learn.benibix.com/learn/infrastructure-networking/http-methods-get-vs-post
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
