Updated on Sep 14, 2023
2
min read
Create a movie
POST
You can use the Movies API to add a new movie to the database. This document provides instructions on how to make a POST request to create a movie entry.
Endpoint
To create a movie, make a POST request to the following endpoint:
Request
Here's an example of how to make a POST request to create a new movie using JavaScript:
In this example, we create a JavaScript object representing the movie's details and use the fetch
function to make an HTTP POST request to the /movies
endpoint. The API will create a new movie entry based on the provided data.
Response
Upon successful creation, the API will respond with the newly created movie's details in JSON format, including its unique identifier (id
) and any additional information provided during the creation process.
Response Example
Now you can create new movie entries in the Movies database via the API. Next, we'll move on to updating movie information using a PATCH request.