Wednesday

python post example



from httplib2 import Http
from urllib import urlencode

url = 'http://de.gigajob.com/req.ax'
#body = {'USERNAME': 'foo', 'PASSWORD': 'bar'}
#headers = {'Content-type': 'application/x-www-form-urlencoded'}
body={'xajax':'ajax_get_sgd_html_display' ,'xajaxargs':'<xjxobj><e><k>searchword</k><v>C%23</v></e><e><k>zip</k><v></v></e><e><k>adtype</k><v>offer</v></e><e> <k>distance</k><v>25</v></e><e><k>country</k><v>all</v></e><e><k>language</k><v>de</v></e><e><k>page</k><v>1</v></e><e><k>sort</k><v>age</v></e><e><k>location</k><v></v></e><e><k>age</k><v>999</v></e></xjxobj>' ,'xajaxargs':'1' ,'xajaxargs':'1' ,'xajaxr':'1234400546535'}
h = Http()
response, content = h.request(url,'POST',urlencode(body))
print response
print content


more...

No comments:

test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...