You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
Markdown
42 lines
1.1 KiB
Markdown
|
|
```
|
|
[build]
|
|
kill_delay = "1s"
|
|
send_interrupt = true
|
|
```
|
|
|
|
|
|
## Get Movie
|
|
|
|
```bash
|
|
curl -i http://0.0.0.0:5002/v1/movies/1
|
|
```
|
|
|
|
## Creating a movie
|
|
|
|
```bash
|
|
curl -i -X POST -d '{"title":"Moana","year":2016,"runtime":"107 mins", "genres":["animation","adventure"]}' http://0.0.0.0:5002/v1/movies
|
|
```
|
|
|
|
```bash
|
|
curl -i -X POST -d '{"title":"The Batman","year":2022,"runtime":"177 mins", "genres":["action","adventure"]}' http://0.0.0.0:5002/v1/movies
|
|
```
|
|
|
|
|
|
```bash
|
|
curl -i -X POST -d '{"title":"Death of a Unicorn","year":2025,"runtime":"126 mins", "genres":["comedy","satire"]}' http://0.0.0.0:5002/v1/movies
|
|
```
|
|
|
|
|
|
```bash
|
|
BODY='{"title":"Black Panther","year":2018,"runtime":"134 mins","genres":["sci-fi","action","adventure"]}'
|
|
curl -X PUT -d "$BODY" http://0.0.0.0:5002/v1/movies/1
|
|
```
|
|
|
|
## Generating an Update Conflict
|
|
|
|
We can try to use the xargs tool to submit multiple requests to our webserver. Hopefully this results in the 409 that we are looking to create.
|
|
|
|
```bash
|
|
xargs -I % -P8 curl -X PATCH -d '{"runtime": "97 mins"}' "localhost:5002/v1/movies/4" < <(printf '%s\n' {1..8})
|
|
``` |