Last active
November 12, 2022 20:26
-
-
Save kyberorg/775d69b309700bfc928d7c97ecfca026 to your computer and use it in GitHub Desktop.
API Endpoint Design Reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET /resources - returns a list of resource items | |
POST /resources - creates one or many resource items | |
PUT /resources - updates one or many resource items | |
PATCH /resources - partially updates one or many resource items | |
DELETE /resources - deletes all resource items | |
And for single resource items: | |
GET /resources/:id - returns a specific resource item based on :id parameter | |
POST /resources/:id - creates one resource item with specified id (requires validation) | |
PUT /resources/:id - updates a specific resource item | |
PATCH /resources/:id - partially updates a specific resource item | |
DELETE /resources/:id - deletes a specific resource item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST: creation of a new thing, where the location (ID) of the new thing will be determined by the server. The response is expected to contain a Location header telling the client where the object ended up (POST-redirect-GET pattern). | |
PUT: creation of a new thing at a client-defined location (in cases where that's allowable), or replacement of the thing at a given location (this includes "updates" where the body being sent by the client is a complete representation of the object, just as you would get from a GET). | |
PATCH: in-place partial-update of the thing at a given location. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment