Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jerald-jacob/php-rest-api
How To Create A Simple REST API in PHP?
https://github.com/jerald-jacob/php-rest-api
Last synced: 4 days ago
JSON representation
How To Create A Simple REST API in PHP?
- Host: GitHub
- URL: https://github.com/jerald-jacob/php-rest-api
- Owner: jerald-jacob
- Created: 2020-03-31T07:13:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-03-31T12:37:52.000Z (over 4 years ago)
- Last Synced: 2024-04-13T20:50:38.748Z (7 months ago)
- Language: PHP
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP-REST-API
How To Create A Simple REST API in PHP?urls
http://localhost/api/product/read.php
# create
http://localhost/api/product/create.phpbody
{
"name" : "Amazing Pillow 2.0",
"price" : "199",
"description" : "The best pillow for amazing programmers.",
"category_id" : 2,
"created" : "2018-06-01 00:35:07"
}# read
http://localhost/api/product/read_one.php?id=60
#update
http://localhost/api/product/update.php
body
{
"id" : "66",
"name" : "Amazing Pillow 3.0",
"price" : "255",
"description" : "The best pillow for amazing programmers.",
"category_id" : 2,
"created" : "2018-08-01 00:35:07"
}# delete
http://localhost/api/product/delete.php
body
{
"id" : "65"
}# search
http://localhost/api/product/search.php?s=shirt
# Paginate Products
http://localhost/api/product/read_paging.php