Day 76 JavaScript Rest API

Today took a deeper look into Rest API the last layer to connecting everything together with JavaScript. REST and API are two separate things individually.

API stands for application program interface. It is essentially a contract provided from one piece of software to another piece of software. The analogy given in the video I watched was of a restaurant. You as a customer sitting waiting to order is the client, the kitchen is the server, and the actual server for your food is the API. In this scenario, the API is the server because it is formatted to take a certain order in a specific way and bring back a certain meal/ data.

Representational state transfer (REST) is an architecture style for designing networked applications. It relies on a stateless, client-server protocol(HTTP). It treats server objects as resources that can be created or destroyed.

In short API is the messenger and REST lets us use HTTP requests to format those messages. As we learned from AJAX HTTP methods are GET, POST, PUT, and DELETE.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Up ↑

%d bloggers like this: