Last active
March 28, 2018 08:40
-
-
Save thesaadarshad/ffec04d0cc30e38fd3c8a9233b9557d0 to your computer and use it in GitHub Desktop.
Python Curl Request Json
This file contains 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
#!/usr/bin/python | |
import requests | |
import json | |
import re | |
url = "https://reqres.in/api/users" | |
querystring = { "demovar": "testvalue" } | |
headers = { 'auth': "FGtbAXGT4QbBLQj97j2P" } | |
response = requests.request("GET", url, headers=headers, params=querystring) | |
print response.status_code | |
print response.headers | |
print response.encoding | |
print response.text | |
print response.json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment