Changing a request to receive a message in python?
3 answers
The variables for the POST request are in the HTTP headers, not in the URL. Check urllib .
edit: Try this (I got it from here ):
import urllib import urllib2 url = 'en.wikipedia.org/w/api.php' values = {'action' : 'login', 'lgname' : 'user', 'password' : 'password' } data = urllib.urlencode(values) req = urllib2.Request(url, data) response = urllib2.urlopen(req) the_page = response.read()
+3
a source to share