Formatting fix for creating a customer and minor typo fix.

This commit is contained in:
Simon Prickett 2021-11-18 21:41:22 +00:00 committed by GitHub
parent 678bc43d3f
commit c1e10b5629
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,11 +118,11 @@ Next, start the server:
$ poetry run uvicorn --reload main:test $ poetry run uvicorn --reload main:test
Then, in another shell, create a customer: Then, in another shell, create a customer:
```
$ curl -X POST "http://localhost:8000/customer" -H 'Content-Type: application/json' -d '{"first_name":"Andrew","last_name":"Brookins","email":"a@example.com","age":"38","join_date":"2020 $ curl -X POST "http://localhost:8000/customer" -H 'Content-Type: application/json' -d '{"first_name":"Andrew","last_name":"Brookins","email":"a@example.com","age":"38","join_date":"2020
-01-02"}' -01-02"}'
{"pk":"01FM2G8EP38AVMH7PMTAJ123TA","first_name":"Andrew","last_name":"Brookins","email":"a@example.com","join_date":"2020-01-02","age":38,"bio":""} {"pk":"01FM2G8EP38AVMH7PMTAJ123TA","first_name":"Andrew","last_name":"Brookins","email":"a@example.com","join_date":"2020-01-02","age":38,"bio":""}
```
Get a copy of the value for "pk" and make another request to get that customer: Get a copy of the value for "pk" and make another request to get that customer:
$ curl "http://localhost:8000/customer/01FM2G8EP38AVMH7PMTAJ123TA" $ curl "http://localhost:8000/customer/01FM2G8EP38AVMH7PMTAJ123TA"
@ -133,7 +133,7 @@ You can also get a list of all customer PKs:
$ curl "http://localhost:8000/customers" $ curl "http://localhost:8000/customers"
{"customers":["01FM2G8EP38AVMH7PMTAJ123TA"]} {"customers":["01FM2G8EP38AVMH7PMTAJ123TA"]}
## Redsi OM with Asyncio ## Redis OM with Asyncio
Redis OM is designed to work with asyncio, so you can use Redis OM models asynchronously within FastAPI applications. Redis OM is designed to work with asyncio, so you can use Redis OM models asynchronously within FastAPI applications.