Skip to content

Instantly share code, notes, and snippets.

@thesaadarshad
Last active March 28, 2018 08:40
Show Gist options
  • Save thesaadarshad/ffec04d0cc30e38fd3c8a9233b9557d0 to your computer and use it in GitHub Desktop.
Save thesaadarshad/ffec04d0cc30e38fd3c8a9233b9557d0 to your computer and use it in GitHub Desktop.
Python Curl Request Json
#!/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