1
0
mirror of https://github.com/actix/examples synced 2024-11-24 06:43:00 +01:00
examples/databases/mysql/apis/branch.md
2023-07-18 01:01:26 +01:00

673 B

Branches API

All examples show cURL and HTTPie snippets.

Adding A Branch

curl -d '{"branch_name":"HQ branch", "location":"Central Business District"}' -H 'Content-Type: application/json' http://localhost:8080/branch

http POST :8080/branch branch_name="HQ branch" branch_name="Central Business District"

You should expect a 204 No Content response.

Listing Branches

curl http://localhost:8080/branch

http :8080/branch

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

{
  "branch_data": [
    {
      "branch_name": "hq branch",
      "location": "central business district"
    }
  ]
}