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');
}
/aws.amazon on your browser , you get a view page with some content.
For more understanding read the following documentation http://apidocjs.com/.
0 Comments