Building the API
A pure REST approach may use all of the HTTP methods detailed in the following table:
HTTP Verb |
Sample URI |
Task performed |
---|---|---|
GET |
|
Retrieves the city with ID 10 |
DELETE |
|
Deletes the city with ID 10 |
POST |
|
Creates a new city |
PUT |
|
Updates the city with ID 10 |
PATCH |
|
Performs a partial update to the city with ID 10 |
OPTIONS |
|
Returns all the available operations on the city with ID 10 |
HEAD |
|
Returns only the HTTP headers |
However, in order to enforce compatibility with old clients of the platform with a restricted set of available HTTP options, we can also choose to be pragmatic and perform every operation with a single verb using HTTP headers ...
Get Mastering Cloud Development using Microsoft Azure now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.