Thiết kế, lập trình Web API cho phép lấy, cập nhật thông tin người sử dụng đối với hệ thống web có chức năng login/logout
- Require env: Linux/Apache/MySQL/PHP
- config for apache: DocumentRoot point to WebApi/public
- config for database: db/config.php
- run file users_table.sql to init users table.
- This application provided two apis:
- Get user information
- Request:
+ url:127.0.0.1/
+ Method: GET
+ Params: id (require)
- Response:
http code 200 and user information in the application found an user.
http code 400 and user information in the application not found any user.
- Get user information
- Request:
+ url:127.0.0.1/
+ Method: POST
+ Params:
id (required)
data[name](required)
data[tel](required)
data[address](required)
data[email](required)
- Response:
http code 200 for update successful.
http code 400 for update unsuccessful.