1
0
mirror of https://github.com/actix/examples synced 2025-06-27 01:27:43 +02:00

improve mysql readme

This commit is contained in:
Rob Ede
2023-07-18 01:01:26 +01:00
parent f3cf37bb0d
commit 048f4fd884
13 changed files with 168 additions and 216 deletions

View File

@ -0,0 +1,34 @@
# Customers API
All examples show cURL and [HTTPie](https://httpie.io/cli) snippets.
## Adding A Customer
```sh
curl -d '{"customer_name":"Peter Paul", "branch_name":"Central Business District"}' -H 'Content-Type: application/json' http://localhost:8080/customer
http POST :8080/customer customer_name="Peter Paul" branch_name="Central Business District"
```
You should expect a 204 No Content response.
## Listing Customers
```sh
curl http://localhost:8080/customer
http :8080/customer
```
The response should be a 200 OK with the following JSON body:
```json
{
"customer_data": [
{
"customer_name": "peter paul",
"branch_name": "central business district"
}
]
}
```