APIs
-
REST is an architectural style for building distributed systems based on hypermedia,REST is independent of any underlying protocol and is not necessarily tied to HTTP
-
resources
-
https://adventure-works.com/orders/1
- The most common HTTP verbs are:
- GET retrieves a representation of the resource at the specified URI. The body of the response message contains the details of the requested resource.
- POST creates a new resource at the specified URI. The body of the request message provides the details of the new resource. Note that POST can also be used to trigger operations that don’t actually create resources.
- PUT either creates or replaces the resource at the specified URI. The body of the request message specifies the resource to be created or updated.
- PATCH performs a partial update of a resource. The request body specifies the set of changes to apply to the resource.
- DELETE removes the resource at the specified URI.
-
On the resource and not verbs.
-
https://www.adventure-works.com/
-
try to avoid “chatty” web APIs that expose a large number of small resources.
-
A successful GET method typically returns HTTP status code 200 (OK)
-
The method should return 404 (Not Found).
-
Returns HTTP status code 200 and include the result of the operation in the response body.
- Respond with HTTP status code 204, indicating that the process has been successfully handled.