Lesson 2 of 8
HTTP Methods
HTTP methods define what action to perform on a resource. GET retrieves data. POST creates new data. PUT updates existing data. DELETE removes data. These four methods cover most API operations.
APIS
# HTTP Methods in REST APIs:
GET /users # Retrieve all users
GET /users/1 # Retrieve user 1
POST /users # Create a new user
PUT /users/1 # Update user 1
DELETE /users/1 # Delete user 1
# Think of it like a restaurant:
# GET = read the menu
# POST = place an order
# PUT = change your order
# DELETE = cancel your order