Create a GET operation that returns an array of the
Movie data type.
Procedure
Click the + button to the right of the
Movies section and select
Operation.
Configure the general information as follows:
Field
Value
Name
Get a list of movies
Method
GET
Path
/movies
Description
Returns a list of movies available for rental.
Id
getMovies
Click Add next to RESPONSES and select 2XX
- Default in the Status field.
Click Add next to
BODY.
In the TYPE section,
select Array in the Type list and Movie in the of
list.
Add the following example in the Examples field:
<movies><movie><movieId>1</movieId><title>The Social Network</title><releaseYear>2010</releaseYear><director>David Fincher</director><price>4.99</price></movie><movie><movieId>2</movieId><title>La La Land</title><releaseYear>2016</releaseYear><director>Damien Chazelle</director><price>5.99</price></movie><movie><movieId>3</movieId><title>Ex Machine</title><releaseYear>2014</releaseYear><director>Alex Garland</director><price>4.99</price></movie></movies>
Click Save.
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!