- Moved HTTP client test files to `internal/requests`.
- Replaced hardcoded `localhost` URLs with `{{base_url}}`.
- Updated `http-client.env.json` to include `base_url` configuration.
83 lines
2 KiB
HTTP
83 lines
2 KiB
HTTP
### Films API sample requests (IntelliJ HTTP Client)
|
|
|
|
### List films (default pagination)
|
|
GET http://{{base_url}}/films
|
|
Accept: application/hal+json
|
|
|
|
### List films with expand and filters
|
|
GET http://{{base_url}}/films?limit=5&offset=0&expand=actors,language&language.name=English
|
|
Accept: application/hal+json
|
|
|
|
### List films filtered by category name
|
|
GET http://{{base_url}}/films?limit=5&category.name=Action
|
|
Accept: application/hal+json
|
|
|
|
### Get a single film
|
|
GET http://{{base_url}}/films/1?expand=actors,language,original_language
|
|
Accept: application/hal+json
|
|
|
|
### Create a film (server computes next film_id)
|
|
POST http://{{base_url}}/films
|
|
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
|
|
POST http://{{base_url}}/films
|
|
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
|
|
PUT http://{{base_url}}/films/{{film_id}}
|
|
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)
|
|
PATCH http://{{base_url}}/films/{{film_id}}
|
|
Content-Type: application/json
|
|
Accept: application/hal+json
|
|
|
|
{
|
|
"title": "Patched Title",
|
|
"rental_rate": 2.99
|
|
}
|
|
|
|
### Delete film
|
|
DELETE http://{{base_url}}/films/{{film_id}}
|
|
|
|
### Related: list actors of a film
|
|
GET http://{{base_url}}/films/{{film_id}}/actors
|
|
Accept: application/hal+json
|