View on GitHub

reading-notes

read 8

API Design Best Practices

Ans: Representational State Transfer.

Ans1: REST APIs are designed around resources, which are any kind of object, data, or service that can be accessed by the client.

Ans2: A resource has an identifier, which is a URI that uniquely identifies that resource. For example, the URI for a particular customer order might be:

Ans: http:// is the protocol. It indicates which protocol the browser must use. Usually it is the HTTP protocol or its secured version, HTTPS. The Web requires one of these two, but browsers also know how to handle other protocols such as mailto: (to open a mail client) or ftp: to handle file transfer, so don’t be surprised if you see such protocols.

Ans: GET, POST, PUT, PATCH, and DELETE.

Ans: Nouns (the resource) and not verbs (the operations on the resource).

Ans: https://adventure-works.com/orders

Ans: Expose a large number of small resources.

Ans: Return a response message with the body containing the value

Ans: If not valid, 400 Bad Request is returned. Order is processed. If the order is successful, a 201 Created is returned for the order

Ans: This means the request was successful and the server created a new resource. … This means the server successfully processed the request, but is not returning any content. Unlike a 204 response, this response requires that the requester reset the document view.

Ans: Responses. If a DELETE method is successfully applied, there are several response status codes possible: A 202 ( Accepted ) status code if the action will likely succeed but has not yet been enacted. A 204 ( No Content ) status code if the action has been enacted and no further information is to be supplied.

Things I want to know more about