RESTful API
When we develop any application with React or JavaScript, we almost always need to request data from a server to dynamically update content inside our application. For example, any social media platform, such as Twitter, Facebook, LinkedIn, Instagram, or YouTube, updates some parts of their content on the page by requesting data from their servers. The content on those platforms is never static.
To request data from a server, there are several web services you can use, such as SOAP
, WSDL
, and REST
. In this chapter, we are going to focus on the popular web service REST
(or RESTful). We are going to talk about what a RESTful API is and how it works and will look into a few practical examples.
REST stands for Representational State Transfer, and it is an architectural style of web architecture with six constraints that allows us to request data via the HTTP protocol using, for instance, GET
and POST
. When something is RESTful, it means it follows the REST constraints...