A summary table of HTTP methods (POST, PUT, PATCH) and their roles in CRUD operations, tailored for the Cash Card API. The table clarifies which methods are implemented (bold rows) and their behavior, including URI definitions, response codes, and response bodies. Non-bold rows indicate features not supported by the Cash Card API.
HTTP Method | Operation | Definition of Resource URI | What Does It Do? | Response Status Code | Response Body |
---|---|---|---|---|---|
POST | Create | Server generates and returns the URI | Creates a sub-resource under the request URI (e.g., /cashcards/101 ) |
201 CREATED |
The created resource |
PUT | Create | Client supplies the URI | Creates a resource at the exact request URI (e.g., /invoices/1234-567 ) |
201 CREATED |
The created resource |
PUT | Update | Client supplies the URI | Replaces the entire resource with the object in the request | 204 NO CONTENT |
(empty) |
PATCH | Update | Client supplies the URI | Partially updates the resource (only modifies specified fields) | 200 OK |
The updated resource |
- Bold rows (implemented):
- POST for creating Cash Cards.
- PUT for replacing entire Cash Card records.
- Non-bold rows (not implemented):
- PUT for creating resources (client-defined URI).
- PATCH for partial updates.
- Use
POST
when the server generates the resource URI (e.g.,/cashcards/101
). - Use
PUT
for full updates (replacing the entire resource). - The Cash Card API does not support client-defined URIs (
PUT
for creation) or partial updates (PATCH
).