This is a simple PHP REST API from scratch with no framework.
Import the myblog.sql file, change the params in the config/Database.php file to your own
-
Method - POST
-
URL - http://soyedotunprojectdemos.000webhostapp.com/php_rest_myblog/api/category/create.php
-
Sample Request
{
"name": "Job"
}
- Sample Response
{
"status": true,
"message": "Category Created"
}
-
Method - GET
-
URL - http://soyedotunprojectdemos.000webhostapp.com/php_rest_myblog/api/category/read.php
-
Sample Response
{
"status": true,
"message": "Categories Found",
"data": [
{
"id": "7",
"name": "Insurance"
},
{
"id": "6",
"name": "Department"
},
{
"id": "1",
"name": "Technology"
},
{
"id": "2",
"name": "Gaming"
},
{
"id": "3",
"name": "Auto"
},
{
"id": "4",
"name": "Entertainment"
},
{
"id": "5",
"name": "Books"
}
]
}
-
Method - GET
-
URL - http://soyedotunprojectdemos.000webhostapp.com/php_rest_myblog/api/category/read_single.php?id=1
-
Sample Response
{
"status": true,
"message": "Category Found",
"data": {
"id": "1",
"name": "Technology"
}
}
-
Method - PUT
-
URL - http://soyedotunprojectdemos.000webhostapp.com/php_rest_myblog/api/category/update.php
-
HEADER
{
"Key": "Content-Type",
"Value": "application/json"
}
- Sample Request
{
"id": "7",
"name": "Insurtech"
}
- Sample Response
{
"status": true,
"message": "Category Updated"
}
-
Method - DELETE
-
URL - http://soyedotunprojectdemos.000webhostapp.com/php_rest_myblog/api/category/delete.php
-
HEADER
{
"Key": "Content-Type",
"Value": "application/json"
}
- Sample Request
{
"id": "7"
}
- Sample Response
{
"status": true,
"message": "Category Deleted"
}
-
Method - GET
-
URL - http://soyedotunprojectdemos.000webhostapp.com/php_rest_myblog/api/category/search.php?s=tech
-
Sample Response
{
"status": true,
"message": "Searched Category Found",
"data": [
{
"id": "1",
"name": "Technology"
}
]
}
-
Method - GET
-
URL - http://soyedotunprojectdemos.000webhostapp.com/php_rest_myblog/api/category/read_paging.php
-
Sample Request
{
"status": true,
"message": "Categories Paging",
"data": [
{
"id": "6",
"name": "Department"
},
{
"id": "1",
"name": "Technology"
},
{
"id": "2",
"name": "Gaming"
},
{
"id": "3",
"name": "Auto"
},
{
"id": "4",
"name": "Entertainment"
}
]
}
Brad Traversy Traversy Media
Sodiq Oyedotun Soyedotun Media
1.0.0
This project is licensed under the MIT License