This forum is now read-only. Please use our new forums at

450 points
Submitted by
almost 3 years ago

8/20 Why won't code go through?

I'm using the code, but it says I need still need to create the variable response. Please help!

var response ="", data = body)

0 votes


Since you're working with Python, you don't need to use the keyword "var" when defining variables; that's JS syntax.

This is the correct code:

#Import the requests module.
import requests.

#Create the body.
body = {'Name':'Eric', 'Age':'26'}

#Send the POST request and store the response in a variable.
response ="", data=body)

You can find more info at the requests website:

848 points
Submitted by
almost 3 years ago