Book Image

Mastering Web Application Development with Express

By : Alexandru Vladutu
Book Image

Mastering Web Application Development with Express

By: Alexandru Vladutu

Overview of this book

Table of Contents (18 chapters)
Mastering Web Application Development with Express
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

An overview of REST


Representational State Transfer (REST) is an architecture style for designing network applications. REST is all about resources, so when creating an API, we need to separate it into logical resources. Resources represent information, and they need to be nouns, not verbs.

To manipulate resources, we use HTTP requests where the methods/verbs are meaningful: GET, POST, PUT, PATCH, and DELETE.

HTTP methods (verbs)

HTTP methods are used to specify the action that should be performed on a resource. The most popular methods are GET and POST, but there are others that are defined as well: CONNECT, DELETE, HEAD, OPTIONS, PUT, PATCH, and TRACE.

Some HTTP methods do not generate any side effects, so they are called safe methods. GET, HEAD, OPTIONS, and TRACE are considered safe, while other methods such as POST, PUT, PATCH, and DELETE are unsafe because they are normally used to change the state of a resource on the server.

Another property of methods is idempotence. A method is idempotent...