Full-Stack Web Development with Vue.js and Node

(singke) #1
Introducing REST APIs Chapter 4

Since there are multiple web services, we have to be able to choose what our requirements
and needs are in order to build the perfect API for our application. The SOAP and REST


protocols both have some benefits as well as limitations.


The SOAP protocol was designed in 1998 by Dave Winer. It uses Extensible Markup
Language (XML) for data exchange. The choice between whether to use SOAP or REST


depends on which programming language we choose when we are developing and the
needs of the application.


REST APIs let us communicate between the applications in a JSON/XML data format.


JSON/XML is a representation of data that is easy to format and readable for a human. With
RESTful APIs, we can perform Create, Read, Update, and Delete (CRUD) operations from


one application to another.


Benefits of REST API


REST API provides a lot of benefits. Here are some of the advantages that we can get by
using REST APIs:


It is easy to make requests and get responses from one application to other.
Responses can be retrieved in human readable format in the form of JSON or
XML.
Everything is manipulated in the form of URI, which means every request is
identified by the URI request.
The separation between client and server makes it easy to migrate to a different
server when needed with minimal change. The segregation between client and
server makes it easy to scale as well.
It is independent of any programming languages. We can implement REST
architecture irrespective of whether we are using PHP, JAVA, Rails, Node.js, and
so on.
it is very easy to get started and the learning curve is short.
Free download pdf