What is RESTFUL API

Before we talk about "REST API", let us know what is API.  API stands for "application program interface".So if you want to interact with someone else's service, you have to use an API.  For example, Google has an API for Authentication, Gmail and many more. As software developers, most of us build REST APIs in a day to day activity. APIs are the default means of communication between the systems.


REST is just a pattern for making APIs. I'd tell you what it stands for, but it doesn't matter. It's just a standard pattern for naming resources that a service provides.

 REST API? It's a standard pattern for an interface for another service that you can use programmatically (from a computer program).

RESTful APIs have various methods to indicate the type of operation we are going to perform with this API 
  • GET — To get a resource or collection of resources.
  • POST — To create a resource or collection of resources.
  • PUT/PATCH — To update the existing resource or collection of resources.
  • DELETE — To delete the existing resource or the collection of resources.
Let us visit a  web address for example


notice the URL and we will take some example and throw light for more understanding.
This https://aws.amazon.com for example in nodejs (javascript server-side) can be


app.get('/aws.amazon.com' , function (request , response){
router.get('/aws.amazon') function(request , response){
response.return('A view of your choice ');
}

// Action to perform here

response.render('' a view page of your choice)
});



or in php it will look like this 
Route::get('/aws.amazon', public function action(){
return view('return a view of your choice');
}

In essence, a restful API is doing "request and response". you send a request on url to
/aws.amazon on your browser , you get a view page with some content.
For more understanding read the following documentation http://apidocjs.com/.

Post a Comment

0 Comments