December 2018
Beginner to intermediate
796 pages
19h 54m
English
Now, we will compose and send an HTTP request to create a new toy:
http POST :8000/toys/ name="PvZ 2 puzzle" description="Plants vs Zombies 2 puzzle" toy_category="Puzzle" was_included_in_home=false release_date="2017-10-08T01:01:00.776594Z"
The following is the equivalent curl command. It is very important to use the -H "Content-Type: application/json" option to indicate to curl that it should send the data specified after the -d option as application/json instead of the default application/x-www-form-urlencoded:
curl -iX POST -H "Content-Type: application/json" -d '{"name":"PvZ 2 puzzle", "description":"Plants vs Zombies 2 puzzle", "toy_category":"Puzzle", "was_included_in_home": "false", "release_date": ...Read now
Unlock full access