I am trying to convert this working curl command:
curl ipinfo.io/8.8.8.8/json?token=$TOKEN
to python3 requests. This is my current script:
#!/usr/bin/env python3
import requests
def getIPInfo ():
params = (
('token', '$TOKEN'),
)
response = requests.get('http://ipinfo.io/8.8.8.8/json', params=params)
print(response)
getIPInfo()
However, when I run it, I get back "Error 403"?
<Response [403]>