Created
April 20, 2012 07:50
-
-
Save fedmich/2426974 to your computer and use it in GitHub Desktop.
Python codes
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
import httplib, urllib | |
params = urllib.urlencode({ | |
'param': 'value', | |
'param2': 'value2' | |
}) | |
headers = { | |
"Content-type": "application/x-www-form-urlencoded", | |
"Accept": "text/plain" | |
} | |
conn = httplib.HTTPConnection("localhost:80") | |
conn.request("POST", "/post/", params, headers) | |
response = conn.getresponse() | |
print response.status, response.reason | |
data = response.read() | |
conn.close() | |
print data | |
#USER AGENT here is blank, Not set |
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
python setup.py install |
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
python setup.py install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment