Making HTTP PUT requests

Now, we will compose and send an HTTP request to update an existing toy, specifically, the previously added toy. We have to check the value assigned to pk in the previous response and replace 4 in the command with the returned value. For example, if the value for pk was 4, you should use :8000/toys/4 instead of :8000/toys/4:

http PUT :8000/toys/4 name="PvZ 3 puzzle" description="Plants vs Zombies 3 puzzle" toy_category="Puzzles & Games" was_included_in_home=false release_date="2017-10-08T01:01:00.776594Z"

The following is the equivalent curl command. As with the previous curl example, it is very important to use the -H "Content-Type: application/json" option to indicate curl to send the data specified after the

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.