POST

POST

  • A POST request creates a new item on the server

  • A request like POST https://restaurant-reviews.com/reviews could make a new review when we click the “Submit review” button on the webpage

  • POST requests are often accompanied by data passed along in the HTTP request body. e.g. when we write a review for Little Beet, we would include our username (eric), our review (The shrimp salad is so delightful), and a star rating (4 out of 5)

  • POST requests often return an ID of the new item, like 3

  • POST requests are not idempotent

    • When we make one of these requests, the state of the server changes

    • Making the request again would create another item with another ID