Match each HTTP method to its common REST API action.
Drag a concept onto its matching description — or click a concept then click the description.
Retrieve a resource
Create a new resource
Update or replace a resource
Remove a resource
Trap 1: GET - Create data
GET is not designed for creation because it is a safe, read-only operation that must not alter server state or trigger side effects. Creating data requires sending a request payload and invoking server-side processing, which is the semantic role of POST. Using GET to create resources violates HTTP constraints, leading to problems such as unintended cacheable state changes and vulnerability to cross-site request forgery.
Trap 2: POST - Retrieve data
POST is not intended for retrieval because it is designed to submit data to a specified resource for processing, typically causing state changes or resource creation. Retrieval is a read-only operation that should use GET, which is safe and idempotent. Although POST can return data in a response, its primary semantic is server-side processing rather than querying existing resources.
Trap 3: PUT - Partially update data
PUT is defined to replace an entire resource with the representation in the request body, making it inappropriate for partial updates. A partial update modifies only a subset of a resource's fields, which is the purpose of the PATCH method. Because PUT is idempotent and requires the complete new state, applying it to a partial payload would cause missing fields to be reset or removed.
- A
GET - Retrieve data
GET is an HTTP method that requests a representation of the specified resource without modifying server state. It is both safe and idempotent, meaning repeated identical GET requests yield the same result and cause no side effects. In REST APIs, GET is the standard operation for read-only retrieval, typically returning a 200 OK response with the resource body.
- B
GET - Create data
Why wrong: GET is not designed for creation because it is a safe, read-only operation that must not alter server state or trigger side effects. Creating data requires sending a request payload and invoking server-side processing, which is the semantic role of POST. Using GET to create resources violates HTTP constraints, leading to problems such as unintended cacheable state changes and vulnerability to cross-site request forgery.
- C
POST - Retrieve data
Why wrong: POST is not intended for retrieval because it is designed to submit data to a specified resource for processing, typically causing state changes or resource creation. Retrieval is a read-only operation that should use GET, which is safe and idempotent. Although POST can return data in a response, its primary semantic is server-side processing rather than querying existing resources.
- D
PUT - Partially update data
Why wrong: PUT is defined to replace an entire resource with the representation in the request body, making it inappropriate for partial updates. A partial update modifies only a subset of a resource's fields, which is the purpose of the PATCH method. Because PUT is idempotent and requires the complete new state, applying it to a partial payload would cause missing fields to be reset or removed.