PHP_API

 https://github.com/lflimeira/PHP_API

PHP_API donwnload

A simple RESTful API PHP without Frameworks, to help you to understand the concepts and the structure used. This way, you can use this example to develop your own API.

Installation

  1. Clone/download this folder to your computer.
  2. Save this folder in your Apache root directory.
  3. Access the DB folder and use the api_database.sql file to create your database.
  4. Change the connection.class.php file in api\connection path, if it's necessary.

How does it work

You can use the API from a web front-end application, mobile app and also using the app called Postman in Chrome (you can download it in Chrome's Web Store using this [link] (https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?utm_source=chrome-ntp-icon)). Here i'm using the Postman to exemplifyed the use of the API.

We have 4 methods of access the API:

  1. GET
  2. POST
  3. PUT
  4. DELETE

GET method

POST method

PUT method

DELETE method

Why should you use APIs?

APIs are a great way to separate the back-end from the front-end of your application, this also makes it possible to develop for different kinds of platforms without change your back-end application and without rewrite your code in differents programming languages. For example: You can have a web application that access an API and develop a mobile application that will access the same API using the same routes. Isn't it awesome?https://github.com/lflimeira/PHP_API

Comments

Popular posts from this blog

Day1