views:

104

answers:

2

All,

How do we send a http request through a python script.which will login and in turn call another link?

Thanks.

A: 

Have you looked at httplib? urllib may also be worth looking at as it is a slightly higher level interface.

Yacoby
Thanks all i found this import httplib>>> conn = httplib.HTTPConnection("www.python.org")>>> conn.request("GET", "/index.html")>>> r1 = conn.getresponse()>>> print r1.status, r1.reason200 OK>>> data1 = r1.read()>>> conn.request("GET", "/parrot.spam")>>> r2 = conn.getresponse()>>> print r2.status, r2.reason404 Not Found>>> data2 = r2.read()>>> conn.close() in the link.....I think it wud suffice for now.....
Hulk
@Hulk: That comment is part of the question. You own the question. You can update the question with additional information. Please update the question and delete this silly comment.
S.Lott
+1  A: 

I find that Urllib2 suffices in most cases. It has great support for passwords, authentication and cookies. Cookielib might help too.

reech