My first experiment with PHP as an API. (With CORS).
- Apache I recommend using XAMPP as it comes with built-in Apache for PHP.
- Go to you XAMPP htdocs directory (usually in
C:\xampp\htdocs, depending on where you installed your XAMPP) - Clone this repository by running
git clone https://github.com/khianvictorycalderon/php-api-response.git - Start Apache from XAMPP control panel.
- Use Apixer as an API tester.
- Go to your browser and type
localhost/php-api-response/api/userto test API Endpoints!
/api/user(GET) – Get all users./api/user?id={id}(GET) – Get single user by ID./api/user(POST) – Create new user (mock only).