An open API service indexing awesome lists of open source software.

https://github.com/phantu279999/testfastapi


https://github.com/phantu279999/testfastapi

Last synced: 7 months ago
JSON representation

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
![img.png](img.png)

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
```