๐ Learn to make Rest API with PHP and MySQL using OOP paradigm and design patterns. (Project of learn PHP and MySQL with PZN).
BASE URL : http://localhost:8080/
Request :
- Endpoint :
/users
- Method : GET
Response :
{
"data": [
{
"id": "",
"name": "",
"username": "",
"email": "",
"created_at": ""
}
]
}
Request :
- Endpoint :
/users/:id
- Method : GET
Response :
{
"data": {
"id": "",
"name": "",
"username": "",
"email": "",
"created_at": ""
}
}
Request :
- Endpoint :
/users/:id/posts
- Method : GET
Response :
{
"data": {
"id": "",
"name": "",
"username": "",
"email": "",
"created_at": "",
"posts": [
{
"id": "",
"title": "",
"description": "",
"body": "",
"id_user": "",
"created_at": "",
}
]
}
}
Request :
- Endpoint :
/posts
- Method : GET
Response :
{
"data": [
{
"id": "",
"name": "",
"username": "",
"email": "",
"created_at": "",
"title": "",
"description": "",
"body": "",
"id_user": "",
"user_created_at": "",
}
]
}
Request :
- Endpoint :
/posts/:id
- Method : GET
Response :
{
"data": {
"id": "",
"name": "",
"username": "",
"email": "",
"created_at": "",
"title": "",
"description": "",
"body": "",
"id_user": "",
"user_created_at": "",
}
}