https://github.com/phantu279999/testfastapi
https://github.com/phantu279999/testfastapi
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/phantu279999/testfastapi
- Owner: phantu279999
- Created: 2025-03-17T14:41:24.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2025-03-17T14:55:56.000Z (7 months ago)
- Last Synced: 2025-03-17T15:51:30.255Z (7 months ago)
- Language: Python
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Test API
setup:
```
pip install -r requirements.txt
```run:
```
uvicorn main:app --reload
```## Test 1
### CRUD Accounts:#### ============ Example Create ============:
```
curl --location --request POST 'http://127.0.0.1:8000/accounts/' \
--header 'Content-Type: application/json' \
--data-raw '{
"login": "testuser2",
"password": "testpassword",
"phone": "1234567893223"
}'
```#### ============ Example Retrieve ============:
```
curl --location --request GET 'http://127.0.0.1:8000/accounts/'
``````
curl --location --request GET 'http://127.0.0.1:8000/accounts?skip=10'
```#### ============ Example Update ============:
```
curl --location --request PUT 'http://127.0.0.1:8000/accounts/1' \
--header 'Content-Type: application/json' \
--data-raw '{
"login": "test323",
"password": "testpassword",
"phone": "0915104795"
}'
```#### ============ Example Delete ==========:
```
curl --location --request DELETE 'http://127.0.0.1:8000/accounts/1'
```## Test 2
ở request ví dụ em thấy trường "contract_app" nhưng em chưa hiểu mục đích sử dụng nó là gì nên em xin phép bỏ qua
Example
```
curl --location --request POST 'http://127.0.0.1:8000/api/showSerialpaso' \
--header 'Content-Type: application/json' \
--data-raw '{
"file": "index2",
"app_env": 0,
"contract_app": 0,
"contract_server": 0
}'
```Result:
```
{
"success": true,
"filename": "index2.html",
"content": "PGgxPklOZGV4IDI8L2gxPg==",
"message": "Seal Info response successfully"
}
```## Test 3
File path: **/test_script/test_3.py**
```
python test_script/test_3.py
```## Test 4
File path: **/test_script/test_4.py**
```
python test_script/test_4.py
```## Test 5
File path: **/test_script/test_5.py**
```
python test_script/test_5.py
```