Created
February 22, 2016 09:26
-
-
Save rishi93/a2030effddbdf398e89e to your computer and use it in GitHub Desktop.
POSTing and GETing in Python
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
#from urllib import urlopen | |
#url = "https://api.thingspeak.com/update?api_key=SR5SPU47GKH6MXT9&field1=17235" | |
#response = urlopen(url).read() | |
#print response | |
import urllib2 | |
import urllib | |
query_args = { 'name':'Active','phone':'Active','address':'from python' } | |
url = 'http://www.oldthrow.com/mySubmit.php' | |
data = urllib.urlencode(query_args) | |
request = urllib2.Request(url, data) | |
response = urllib2.urlopen(request).read() | |
print response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment