API Fundamentals Course
API Fundamentals
/
Beginner

POST

Definition

An HTTP method used to send data to a server to CREATE a new resource.

Explain Like I'm New

If GET is reading a book, POST is writing a completely new book. The client bundles up a package of data (like a filled-out signup form) and hands it to the server. The server takes that data and creates something new in its database.

Real World Example

Creating a new Twitter account. Submitting a new comment on a YouTube video. Uploading a photo to Instagram.

Common Use Cases

  • •Creating database records
  • •Uploading files
  • •Submitting secure forms

Interactive Example

Loading...
Console output will appear here...

Interview Questions

basic

  • Where is the data placed in a POST request?

intermediate

  • Is a POST request Idempotent?

Flash Cards

Question

Where is data placed?

Click to reveal answer
Answer

In the HTTP Request Body. Unlike GET requests, POST data is hidden inside the body payload, not exposed in the URL.

Question

Is it Idempotent?

Click to reveal answer
Answer

NO! Calling POST 1 time creates 1 user. Calling POST 10 times creates 10 duplicate users. It is not idempotent because the server state changes every single time.