G
5

My first API call returned garbage and it took me 4 tries to fix it

I finally got my Python script to hit a weather API in Toronto last night, but the JSON came back as a huge string of nonsense instead of the temperature. Turns out I forgot to use response.json() and was printing the raw text object. After 3 failed attempts and a quick search at 2 AM, I added .json() and it worked. Has anyone else ran into dumb mistakes with API responses when you're just starting out?
1 comments

Log in to join the discussion

Log In
1 Comment
the_miles
the_miles26d ago
Did the error message at least point you in the right direction, or was it totally useless?
9