Last active
February 2, 2018 13:35
-
-
Save ronbeltran/92510bf9b9e551b090b26a865c6980b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
token = "your-api-token" | |
headers = { | |
"Content-Type": "application/json", | |
"Authorization": "Token {}".format(token) | |
} | |
payload = { | |
"useragent": "Mozilla/5.0 (iPad; CPU OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B176" | |
} | |
url = "https://useragentinfo.co/api/v1/device/" | |
r = requests.post(url, headers=headers, data=json.dumps(payload)) | |
result = r.json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment