REST API
As a web developer at some point you’ll hear the words API (Application Programming Interface) and the word REST. REST stands for REpresentational State Transfer. When a RESTful API is call the server will transfer to the client a representation of the state of the request resource. Said another way, when an API is called with a request for the number of books in the library, the library API will return back the state of the books in the library, which includes the number and a timestamp to signify when that information was last updated. The format typically is in JSON which we’ve written about before. When we make an API call we specify a certain URL or Uniform Resource Locator and we specify an operation that we want the server to perform on that resource in the form of an HTTP method which is a verb. Those are GET, POST, PUT, DELETE. In the library book example, we want to GET a number of all the books.
Let’s continue with our library API and create a couple of API routes:
Read more about it here