1
0
mirror of https://github.com/actix/examples synced 2024-11-23 22:41:07 +01:00
examples/databases/mysql/apis/branch.txt
2023-07-17 18:56:41 +01:00

43 lines
698 B
Plaintext

1.
Linux
curl -d '{"branch_name":"HQ branch", "location":"Central Business District"}' -H 'Content-Type: application/json' http://127.0.0.1:8080/branch
2.
Windows
curl -H "Content-type:application/json" --data-binary "{\"branch_name\":\"HQ branch\", \"location\":\"Central Business District\"}" http://127.0.0.1:8080/branch
3.
JSON response
{
"status_code": 0,
"status_description": "Successful"
}
4.
Linux
curl 'http://localhost:8080/branch'
5.
Windows
curl http://localhost:8080/branch
6.
JSON response
{
"status_code": 0,
"status_description": "Successful",
"branch_data": [
{
"branch_name": "hq branch",
"location": "central business district"
}
]
}