Book Image

Node.js Blueprints

By : Krasimir Stefanov Tsonev
Book Image

Node.js Blueprints

By: Krasimir Stefanov Tsonev

Overview of this book

Table of Contents (19 chapters)
Node.js Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Discovering REST and API


REST stands for Representational State Transfer and it is an architectural principle of the Web. In most of the cases, we have resources on the server that need to be created, fetched, updated, or deleted. The REST APIs provide mechanisms to perform all these operations. Every resource has its own URI and based on the request method, a different action occurs. For example, let's say that we need to manage the users in our social network. To retrieve information about a specific user, we will perform the GET request to the /user/23 address, where the number, 23, is the ID of the user. To update the data, we will send the PUT request to the same URL, and to delete the record, we'll send the DELETE request. The POST requests are reserved to create new resources. In other words, the resources' management on the server happens via HTTP requests sent to carefully selected addresses by using the GET, POST, PUT, and DELETE methods, which are very often called HTTP verbs...