[BangPypers] post method

Noufal Ibrahim noufal at gmail.com
Thu Dec 23 17:55:00 CET 2010


On Thu, Dec 23 2010, Anirudh Asokan wrote:


[...]

> #!/usr/bin/python
> import urllib,urllib2
> url = 'http://results.vtu.ac.in/default.php'
> parameters = {'rid' : '1hk09cs043'}
> 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)
> print page

I haven't tried with the first but with the above, the backend
processes the POST only if the "submit" parameter is specified (the
value is apparently irrelevant). 

curl -d rid=1hk09cs043 -d submit=SUBMIT http://results.vtu.ac.in/default.php | grep -i roshan 

will work but

curl -d rid=1hk09cs043 -d http://results.vtu.ac.in/default.php | grep -i roshan 

will not. 


-- 


More information about the BangPypers mailing list