1
0
mirror of https://github.com/actix/examples synced 2025-01-22 22:05:57 +01:00
examples/databases/mysql/apis/customer.txt
2023-07-17 18:56:41 +01:00

43 lines
732 B
Plaintext

1.
Linux
curl -d '{"customer_name":"Peter Paul", "branch_name":"Central Business District"}' -H 'Content-Type: application/json' http://127.0.0.1:8080/addcustomer
2.
Windows
curl -H "Content-type:application/json" --data-binary "{\"customer_name\":\"Peter Paul\", \"branch_name\":\"Central Business District\"}" http://127.0.0.1:8080/addcustomer
3.
JSON response
{
"status_code": 0,
"status_description": "Successful"
}
4.
Linux
curl 'http://localhost:8080/customer'
5.
Windows
curl http://localhost:8080/customer
6.
JSON response
{
"status_code": 0,
"status_description": "Successful",
"customer_data": [
{
"customer_name": "peter paul",
"branch_name": "central business district"
}
]
}