Reading-Notes


Project maintained by eslamakram Hosted on GitHub Pages — Theme by mattgraham

API Design

  1. What does REST stand for? Representational State Transfer
  2. REST APIs are designed around resources
  3. What is an identifer of a resource? Give an example. Each resource is identified by a Uniform Resource Identifier (URI) used throughout HTTP for identifying resources. for example: https://adventure-works.com/orders
  4. What are the most common HTTP verbs?
    The most-commonly-used HTTP verbs (or methods) are POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete (or CRUD) operations, respectively.
  5. What should the URIs be based on? resource URIs should be based on nouns (the resource) and not verbs (the operations on the resource).
  6. Give an example of a good URI. https://adventure-works.com/orders // Good https://adventure-works.com/create-order // Avoid
  7. What does it mean to have a ‘chatty’ web API? Is this a good or a bad thing? Chatty APIs suck. A chatty API, as defined by Reese, is any API that requires consumer to do more than a single call to perform a single, common operation. The details of what constitutes chatty, of course, depend on what people might reasonably want to do with the API. so it is a bad thing
  8. What status code does a successful GET request return? A successful GET method typically returns HTTP status code 200 (OK).
  9. What status code does an unsuccessful GET request return?If the resource cannot be found, the method should return 404 (Not Found).
  10. What status code does a successful POST request return?If a POST method creates a new resource, it returns HTTP status code 201 (Created)
  11. What status code does a successful DELETE request return?If a PUT method creates a new resource, it returns HTTP status code 201 (Created), as with a POST method. If the method updates an existing resource, it returns either 200 (OK) or 204 (No Content). In some cases, it might not be possible to update an existing resource. In that case, consider returning HTTP status code 409 (Conflict).

Things I want to know more about

node.js and how connect backend with frontend sides