

The JSON is the most common output format of REST API and we are going to make a REST API which accepts GET request and gives JSON output. A sample REST API diagram is given below. The point is that you can obtain the output you need in a form that’s easy to parse within the language you need for your application. The REST based web services can give output in any format like Command Separated Value (CSV), JavaScript Object Notation (JSON) and Really Simple Syndication (RSS). It is as simple as giving an HTTP GET or POST or PUT or DELETE request from the client (Mobile Application, A website etc.) to the server to get some information from the server or to give some information to the server. We used REST API to fetch or give some information from a web service. In this tutorial, I will show you the easiest method to create your own REST API in PHP.īefore we start implementation details let's understand what is REST. REST is much easier and more widely used than SOAP (about 70% web services API uses REST API) and is the newcomer to the block which seeks to fix all problems with SOAP. REST ( Representational State Transfer) is a way of accessing the web services. REST as an architecture style does not require processing and is more simple and flexible than SOAP( Simple Object Access Protocol) which is another standards-based Web services access protocol developed by Microsoft.
