Return to Snippet

Revision: 14199
at May 23, 2009 15:26 by atr000


Initial Code
#!/usr/bin/python
import urllib,urllib2

url = 'http://www.commentcamarche.net/search/search.php3'
parameters = {'Mot' : 'Gimp'}

data = urllib.urlencode(parameters)    # Use urllib to encode the parameters
request = urllib2.Request(url, data)
response = urllib2.urlopen(request)    # This request is sent in HTTP POST
page = response.read(200000)

Initial URL

                                

Initial Description
I see almost all GET, so this is handy to have around

Initial Title
python: urllib2 http post

Initial Tags
http, post, python

Initial Language
Python