reading-notes

Code Fellows Notes

View project on GitHub

301 Reading Eight

API Design Best Practices

  • What does REST stand for?

answer- Representational State Transfer.

  • REST APIs are designed around a __.

answer- resource.

  • What is an identifer of a resource? Give an example.

answer- a URI that identifies a unique resource. https://something.com/orders/3

  • What are the most common HTTP verbs?

answer- GET, POST, PUT PATCH, AND DELETE.

  • What should the URIs be based on?

answer- The resource.

  • Give an example of a good URI.

answer- https://something.com/orders

  • What does it mean to have a ‘chatty’ web API? Is this a good or a bad thing?

answer - They expose a large number of small resources. It is bad and should be avoided.

  • What status code does a successful GET request return?

answer- 200

  • What status code does an unsuccessful GET request return?

answer- 404

  • What status code does a successful POST request return?

answer- 201

  • What status code does a successful DELETE request return?

answer- 204

main