[Tin tức] PHẦN 28 | Trở thành chuyên gia API Server – Hướng dẫn tất tần tật về API từ Server tới Client /PHP



Trở thành chuyên gia API Server – Hướng dẫn tất tần tật về API từ Server tới Client – Lập trình PHP

Xây dựng dự án sử dụng API
– Backend: (PHP) -] logic nghiệp vụ
– Client:
– Mobile, PC Application
– Frontend -] HTML/CSS/JS

========================================
Mini Project:

– Backend:
API
Authen:
– login
– register
– userList
– update/delete/add =] Tự viết thêm =] Bài tập
Product:
– productList
– add/update/delete =] Tự viết thêm =] Bài tập
– Client: Web Client -] Goi API
login page
register page
userList page
productList page

Triển khai:

B1. Xậy dựng database.
– Tao Tables: users, products
– Fake du lieu

B2. Phân tịch API

BASE_URL:

Authen:
API: login
– URL: api/authen.php
– Method: POST
– Request: {
“action”: “login”,
“email”: “tranvandiep.it@gmail.com”,
“password”: “123456”
}
– Response: {
“status”: 1 (1: success, 2 failed),
“msg”: “Error ???”
}
API: login
– URL: api/authen.php
– Method: POST
– Request: {
“action”: “logout”
}
– Response: {
“status”: 1 (1: success, 2 failed),
“msg”: “Error ???”
}
API: register
– URL: api/authen.php
– Method: POST
– Request: {
“action”: “register”,
“fullname”: “TRAN VAN DIEP”,
“username”: “dieptv”,
“email”: “tranvandiep.it@gmail.com”,
“password”: “123456”,
“address”: “Ha Noi”
}
– Response: {
“status”: 1 (1: success, 2 failed),
“msg”: “Error ???”
}
API: userList
– URL: api/authen.php
– Method: POST
– Request: {
“action”: “list”
}
– Response: {
“status”: 1 (1: success, 2 failed),
“msg”: “Error ???”,
“userList”: [
{
“id”: “1”,
“fullname”: “TRAN VAN DIEP”,
“username”: “dieptv”,
“email”: “tranvandiep.it@gmail.com”,
“address”: “Ha Noi”
}, {
“id”: “2”,
“fullname”: “TRAN VAN DIEP”,
“username”: “dieptv”,
“email”: “tranvandiep.it@gmail.com”,
“address”: “Ha Noi”
}
]
}
Product:
API: productList
– URL: api/product.php
– Method: POST
– Request: {
“action”: “list”
}
– Response: {
“status”: 1 (1: success, 2 failed),
“msg”: “Error ???”,
“productList”: [
{
“id”: “1”,
“title”: “Bai viet”,
“thumbnail”: “URL”,
“updated_at”: “2021-06-12 12:02”
}, {
“id”: “2”,
“title”: “Bai viet”,
“thumbnail”: “URL”,
“updated_at”: “2021-06-12 12:02”
}
]
}

B3. Code Server Backend
– Xay dung 1 khung chuong trinh
– db
– config.php
– dbhelper.php
– utils
– utility.php
– api
– authen.php
– product.php

#PHP #MySQL #GokiSoft

9 bình luận về “[Tin tức] PHẦN 28 | Trở thành chuyên gia API Server – Hướng dẫn tất tần tật về API từ Server tới Client /PHP”

Viết một bình luận

bahis10bets.com betvole1.com casinomaxi-giris.com interbahis-giris1.com klasbahis1.com mobilbahisguncelgiris1.com piabetgiris1.com tipobettgiris.com tumbetgiris1.com betboro 1xbet giriş
bahis10bets.com betvole1.com casinomaxi-giris.com interbahis-giris1.com klasbahis1.com mobilbahisguncelgiris1.com piabetgiris1.com tipobettgiris.com tumbetgiris1.com betboro 1xbet giriş
antalya bayan escort
antalya bayan escort
antalya bayan escort