rg_backend_academy/lecture_5/dinosaurs/dinosaurs.http

38 lines
874 B
HTTP

### List all dinosaurs
GET http://localhost:3000/dinosaurs
### Get one dinosaur
GET http://localhost:3000/dinosaurs/1
### Invalid dinosaur ID
GET http://localhost:3000/dinosaurs/not-a-number
### Missing dinosaur
GET http://localhost:3000/dinosaurs/999999
### Create a dinosaur
POST http://localhost:3000/dinosaurs
Content-Type: application/json
{
"name": "Triceratops",
"description" : "Triceratops (neboli třírohá tvář) ",
"period": "křída",
"wikipediaAddress": "https://cs.wikipedia.org/wiki/Triceratops"
}
### Replace a dinosaur
PUT http://localhost:3000/dinosaurs/16
Content-Type: application/json
{
"name": "Tyrannosaurus",
"description": "Tyrannosaurus ",
"period": "křída",
"wikipediaAddress": "https://en.wikipedia.org/wiki/Tyrannosaurus"
}
### Delete a dinosaur
DELETE http://localhost:3000/dinosaurs/2