Skip to content

Commit

Permalink
chore: update example docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dtiesling committed Feb 15, 2024
1 parent 1eddb8f commit 43f008c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions examples/00_quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ generated by Flask-Muck.

### Create a ToDo item
```
curl -X POST --location "http://127.0.0.1:5000/api/v1/todos" \
curl -X POST --location "http://127.0.0.1:5000/todos" \
-H "Content-Type: application/json" \
-d "{
\"text\": \"take out garbage again\"
Expand All @@ -28,44 +28,44 @@ curl -X POST --location "http://127.0.0.1:5000/api/v1/todos" \

### List all ToDo items (flat)
```
curl -X GET --location "http://127.0.0.1:5000/api/v1/todos" \
curl -X GET --location "http://127.0.0.1:5000/todos" \
-d "Accept: application/json"
```

### List all ToDo items (paginated)
```
curl -X GET --location "http://127.0.0.1:5000/api/v1/todos?limit=2&offset=1" \
curl -X GET --location "http://127.0.0.1:5000/todos?limit=2&offset=1" \
-d "Accept: application/json"
```

### Search ToDo items
```
curl -X GET --location "http://127.0.0.1:5000/api/v1/todos?search=garbage" \
curl -X GET --location "http://127.0.0.1:5000/todos?search=garbage" \
-d "Accept: application/json"
```

### Filter ToDo items
```
curl -X GET --location "http://127.0.0.1:5000/api/v1/todos?filters=%7B%22text%22%3A+%22take+out+garbage+again%22%7D" \
curl -X GET --location "http://127.0.0.1:5000/todos?filters=%7B%22text%22%3A+%22take+out+garbage+again%22%7D" \
-d "Accept: application/json"
```
_querystring urldecodes to `filters={"text": "take out garbage again"}`_

### Sort ToDo items
```
curl -X GET --location "http://127.0.0.1:5000/api/v1/todos?sort=text" \
curl -X GET --location "http://127.0.0.1:5000/todos?sort=text" \
-d "Accept: application/json"
```

### Fetch ToDo item
```
curl -X GET --location "http://127.0.0.1:5000/api/v1/todos/1" \
curl -X GET --location "http://127.0.0.1:5000/todos/1" \
-d "Accept: application/json"
```

### Update ToDo item
```
curl -X PUT --location "http://127.0.0.1:5000/api/v1/todos/1" \
curl -X PUT --location "http://127.0.0.1:5000/todos/1" \
-H "Content-Type: application/json" \
-d "{
\"text\": \"Updated todo item\"
Expand All @@ -74,7 +74,7 @@ curl -X PUT --location "http://127.0.0.1:5000/api/v1/todos/1" \

### Patch ToDo item
```
curl -X PATCH --location "http://127.0.0.1:5000/api/v1/todos/1" \
curl -X PATCH --location "http://127.0.0.1:5000/todos/1" \
-H "Content-Type: application/json" \
-d "{
\"text\": \"Updated todo item\"
Expand All @@ -83,7 +83,7 @@ curl -X PATCH --location "http://127.0.0.1:5000/api/v1/todos/1" \

### Delete ToDo Item
```
curl -X DELETE --location "http://127.0.0.1:5000/api/v1/todos/1"
curl -X DELETE --location "http://127.0.0.1:5000/todos/1"
```


0 comments on commit 43f008c

Please sign in to comment.