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

How to use APIs with Python Forum

View Course » View Exercise

662 points
50e19936fbcad9bcb70053af_845944743
Submitted by
Joseph Pope
almost 5 years ago

Code seems correct, but it won't pass

response = requests.post("http://codecademy.com/learn-http/", data=body)

I get this error:
Oops, try again.
Did you pass the correct URL to the requests.post() method?

What am I missing?


15 votes

permalink

you need to first delete line 12 then paste response = requests.post("http://codecademy.com/learn-http/", data=body)

1063 points
4f0ca330812ae70001001202_132881648
Submitted by
Mitch Henderson
over 4 years ago

1 Comment

53888fa280ff3325790030a1_138435731 hatcat over 3 years ago

there's no line 12


6 votes

permalink

response = requests.post("http://codeacademy.com/learn-http/",data=body) still not working for me
Oops, try again.
Did you pass the correct URL to the requests.post() method?

578 points
Cdc23ce11b5e0556a66f89eb47237b50?s=140&d=retro
Submitted by
mikez834
almost 5 years ago

9 Comments

Picture Nick Edwards almost 5 years ago

The URL is codecademy (drop the first a), not codeacademy - I also made this mistake!

536bbf5780ff33e089000b4a_549065504 James Grant almost 5 years ago

wow. well, that fixed it for me. Thanks, Nick!

5134e32ac2e17f8d6f000ace_818777528 Bhumish Gajjar over 4 years ago

Haha, the pain of writing the URL with our keyboard instead of copying!

9633783b364e5f8e5b4caef8de22901c?s=140&d=retro Sukumar over 4 years ago

thanks nick

Picture dancraig67 over 4 years ago

It looks like you made the same mistake I did. The name of this site is codecademy, not codeacademy. Take out the 'a' in your url. Can't believe I did the whole Python track without knowing that...

Cfb2fe20f94d181d566f8216884083b6?s=140&d=retro the_thief over 4 years ago

Thanks Nick!

51284ec6fb30ed29a000079f_768096589 Grey Elerson almost 4 years ago

Wow! I missed that too! I've been spelling it wrong for over a year!

4f0ca330812ae70001001202_132881648 Mitch Henderson almost 4 years ago

No "a" in codecademy!

52ed1fc2282ae34a8e00156b_810441609 Scott O'Neill over 3 years ago

I did the same :)


0 votes

permalink

Sorry, slight bug in the SCT was expecting a "www" in the address. That code should work now!

352 points
501c279f28e19000020169ce_91422859
Submitted by
Fletcher Heisler
almost 5 years ago

1 Comment

53888fa280ff3325790030a1_138435731 hatcat over 3 years ago

no not working


0 votes

permalink

you should make "reset" and type again.

340 points
Picture
Submitted by
Maria Ioannou
over 4 years ago