Skip to content

Instantly share code, notes, and snippets.

@hongruiqi
Created August 24, 2014 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hongruiqi/61cee22d8d2422e49f6c to your computer and use it in GitHub Desktop.
Save hongruiqi/61cee22d8d2422e49f6c to your computer and use it in GitHub Desktop.
import urllib2
import urllib
headers = {
"X-Auth-Token": "xxxx",
"Content-Type": "application/json"
}
data = {
"id": "alert",
"fields": "id
}
data_encode = urllib.urlencode(data)
req = urllib2.Request(url="https://url", method="GET", headers=headers, data=data_encode)
print urllib2.urlopen(req).read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment