HTTP methods are the standard set of verbs a client uses to tell a server what kind of action to perform on a resource.
Key Points: • GET retrieves a resource without modifying it. • POST creates a new resource or submits data for processing. • PUT replaces an existing resource entirely with the provided data. • DELETE removes the specified resource. • PATCH applies a partial update to a resource, changing only the fields provided. • HEAD and OPTIONS also exist, returning headers only or describing what methods a resource supports, respectively.
Example: A blog API uses GET /posts/1 to read a post, POST /posts to create a new one, PUT /posts/1 to replace it entirely, PATCH /posts/1 to update just the title, and DELETE /posts/1 to remove it.
Interview Tip: A concise interview answer is:
"The core HTTP methods are GET for reading, POST for creating, PUT for replacing a resource entirely, PATCH for partial updates, and DELETE for removing a resource. They map cleanly onto CRUD operations, which is why REST APIs are built around them."