2025-09-08 15:28:19 +02:00
|
|
|
### Films API sample requests (IntelliJ HTTP Client)
|
|
|
|
|
|
|
|
|
|
### List films (default pagination)
|
2025-09-08 15:34:23 +02:00
|
|
|
GET http://{{base_url}}/films
|
2025-09-08 15:28:19 +02:00
|
|
|
Accept: application/hal+json
|
|
|
|
|
|
|
|
|
|
### List films with expand and filters
|
2025-09-08 15:34:23 +02:00
|
|
|
GET http://{{base_url}}/films?limit=5&offset=0&expand=actors,language&language.name=English
|
2025-09-08 15:28:19 +02:00
|
|
|
Accept: application/hal+json
|
|
|
|
|
|
|
|
|
|
### List films filtered by category name
|
2025-09-08 15:34:23 +02:00
|
|
|
GET http://{{base_url}}/films?limit=5&category.name=Action
|
2025-09-08 15:28:19 +02:00
|
|
|
Accept: application/hal+json
|
|
|
|
|
|
|
|
|
|
### Get a single film
|
2025-09-08 15:34:23 +02:00
|
|
|
GET http://{{base_url}}/films/1?expand=actors,language,original_language
|
2025-09-08 15:28:19 +02:00
|
|
|
Accept: application/hal+json
|
|
|
|
|
|
|
|
|
|
### Create a film (server computes next film_id)
|
2025-09-08 15:34:23 +02:00
|
|
|
POST http://{{base_url}}/films
|
2025-09-08 15:28:19 +02:00
|
|
|
Content-Type: application/json
|
|
|
|
|
Accept: application/hal+json
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"title": "Sample Movie",
|
|
|
|
|
"description": "A test film created via HTTP client",
|
|
|
|
|
"release_year": "2025",
|
|
|
|
|
"language_id": 1,
|
|
|
|
|
"rental_duration": 3,
|
|
|
|
|
"rental_rate": 4.99,
|
|
|
|
|
"length": 120,
|
|
|
|
|
"replacement_cost": 19.99,
|
|
|
|
|
"rating": "PG",
|
|
|
|
|
"special_features": "Trailers,Deleted Scenes"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
### Create a film with explicit film_id
|
2025-09-08 15:34:23 +02:00
|
|
|
POST http://{{base_url}}/films
|
2025-09-08 15:28:19 +02:00
|
|
|
Content-Type: application/json
|
|
|
|
|
Accept: application/hal+json
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"film_id": 10001,
|
|
|
|
|
"title": "Explicit ID Film",
|
|
|
|
|
"language_id": 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
### Replace film (PUT)
|
|
|
|
|
# Note: Replace the :id variable below to match an existing film id
|
2025-09-08 15:34:23 +02:00
|
|
|
PUT http://{{base_url}}/films/{{film_id}}
|
2025-09-08 15:28:19 +02:00
|
|
|
Content-Type: application/json
|
|
|
|
|
Accept: application/hal+json
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"title": "Updated Title (PUT)",
|
|
|
|
|
"description": "Full replacement payload",
|
|
|
|
|
"release_year": "2024",
|
|
|
|
|
"language_id": 1,
|
|
|
|
|
"original_language_id": 2,
|
|
|
|
|
"rental_duration": 5,
|
|
|
|
|
"rental_rate": 3.99,
|
|
|
|
|
"length": 95,
|
|
|
|
|
"replacement_cost": 14.99,
|
|
|
|
|
"rating": "PG-13",
|
|
|
|
|
"special_features": "Trailers,Behind the Scenes"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
### Patch film (partial update)
|
2025-09-08 15:34:23 +02:00
|
|
|
PATCH http://{{base_url}}/films/{{film_id}}
|
2025-09-08 15:28:19 +02:00
|
|
|
Content-Type: application/json
|
|
|
|
|
Accept: application/hal+json
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"title": "Patched Title",
|
|
|
|
|
"rental_rate": 2.99
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
### Delete film
|
2025-09-08 15:34:23 +02:00
|
|
|
DELETE http://{{base_url}}/films/{{film_id}}
|
2025-09-08 15:28:19 +02:00
|
|
|
|
|
|
|
|
### Related: list actors of a film
|
2025-09-08 15:34:23 +02:00
|
|
|
GET http://{{base_url}}/films/{{film_id}}/actors
|
2025-09-08 15:28:19 +02:00
|
|
|
Accept: application/hal+json
|