API de films
Des films connus avec réalisateurs, genres, distribution, notes et box-office. Données fixes en mémoire : les écritures durent jusqu’au redémarrage de l’application.
- GET
https://api.testingapis.com/api/MoviesList movies with filtering, sorting, search and pagination. - POST
https://api.testingapis.com/api/MoviesCreate a movie. - GETHEAD
https://api.testingapis.com/api/Movies/{id}Get a movie by ID (HEAD returns the headers only). - PUT
https://api.testingapis.com/api/Movies/{id}Replace a movie. - PATCH
https://api.testingapis.com/api/Movies/{id}Partially update a movie with a JSON merge patch. - DELETE
https://api.testingapis.com/api/Movies/{id}Delete a movie. - POST
https://api.testingapis.com/api/Movies/bulkCreate up to 100 movies in one request. - DELETE
https://api.testingapis.com/api/Movies/bulkDelete several movies by ID. - GET
https://api.testingapis.com/api/Movies/countCount all movies. - GET
https://api.testingapis.com/api/Movies/genresList every genre used by any movie, sorted and without duplicates. - GET
https://api.testingapis.com/api/Movies/topList the highest-rated movies. - GET
https://api.testingapis.com/api/Movies/year/{year}List movies released in a given year.
Exemple de requête
List movies with filtering, sorting, search and pagination. Référence complète et bouton Send (en anglais).
cURL
curl -X GET "https://api.testingapis.com/api/Movies?limit=2"Réponse · 200 OK
[
{
"id": 1,
"title": "The Shawshank Redemption",
"director": "Frank Darabont",
"year": 1994,
"genres": ["Drama"],
"runtimeMinutes": 142,
"rating": 9.3,
"cast": ["Tim Robbins", "Morgan Freeman"],
"boxOffice": 58300000,
"poster": "https://picsum.photos/seed/movie1/300/450"
… (3 more lines)Filtres, tri et pagination
Le point d’accès de liste accepte limit, page, offset, sort, order et q, ainsi que n’importe quel nom de champ comme filtre exact. Le total revient dans l’en-tête X-Total-Count. Les écritures restent en mémoire jusqu’au redémarrage du serveur, donc les tests peuvent créer, modifier et supprimer des enregistrements librement. Référence des paramètres de query.