API:--> APPLICATION PROGRAMMING INTERFACE
- The function of API is to connect one application with the data and services of another application by granting all the required permissions.
- In simpler word, it is the connector b/w the two applications.
REST API :-->REPRESENTATIONAL STATE TRANSFER API
- It is a web-service API which uses Urls,HTTP protocol and JSON for data format.
- REST means when a user send a request to the server than the server create an object & sends the state of that object...
EXAMPLE OF REST API:-->
Suppose we want to build a weather reporting app or implement a weather forecasting function in our website so, how we find the temperature of every place..Either we have to put the sensors in every place or use the API which already broadcast the weather report. Obviously, it is not possible to put the sensors in all the places so we have to the second option...Whenever, a user wants the weather of a particular place he simple send the name of that place and the server creates an object and sends back to the state of that object.. Pretty simple right....😃
Some of the important status which we received from the server..
- 200-->i.e. all set
- 400-->i.e. Bad request
- 401-->i.e. we are unauthorised to access this page.
- 402-->i.e. need payment to access this page.
- 403-->i.e. Forbidden error (not access)
- 404-->i.e. page not found
- 500-->i.e. http server error
Comments
Post a Comment