Making requests that paginate results

Now, we will compose and send an HTTP GET request to retrieve all the drones. The new pagination settings will take effect and we will only retrieve the first page for the drones resource collection:

    http GET :8000/drones/  

The following is the equivalent curl command:

    curl -iX GET localhost:8000/drones/

The previous commands will compose and send an HTTP GET request. The request specifies /drones/, and therefore, it will match the '^drones/$' regular expression and run the get method for the views.DroneList class-based view. The method executed in the generic view will use the new settings we added to enable the offset/limit pagination, and the result will provide us with the first four drone resources. ...

Get Learn Web Development with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.