mirror of
https://github.com/actix/examples
synced 2024-12-18 00:13:57 +01:00
579 B
579 B
Banks API
All examples show cURL and HTTPie snippets.
Adding A Bank
curl -d '{"bank_name":"Bank ABC","country":"Kenya"}' -H 'Content-Type: application/json' http://localhost:8080/bank
http POST :8080/bank bank_name="Bank ABC" country="Kenya"
You should expect a 204 No Content response.
Listing Banks
curl http://localhost:8080/bank
http :8080/bank
The response should be a 200 OK with the following JSON body:
{
"bank_data": [
{
"bank_name": "bank abc",
"country": "kenya"
}
]
}