1
0
mirror of https://github.com/actix/examples synced 2024-12-18 08:23:10 +01:00
examples/databases/mysql/apis/teller.md
2023-07-18 01:01:26 +01:00

674 B

Tellers API

All examples show cURL and HTTPie snippets.

Adding A Teller

curl -d '{"teller_name":"John Doe", "branch_name":"Central Business District"}' -H 'Content-Type: application/json' http://localhost:8080/teller

http POST :8080/teller teller_name="John Doe" branch_name="Central Business District"

You should expect a 204 No Content response.

Listing Tellers

curl http://localhost:8080/teller

http :8080/teller

The response should be a 200 OK with the following JSON body:

{
  "teller_data": [
    {
      "teller_name": "john doe",
      "branch_name": "central business district"
    }
  ]
}