Definition at line 743 of file urllib2.py.
def do_open |
( |
|
self, |
|
|
|
http_class, |
|
|
|
req |
|
) |
| |
Definition at line 745 of file urllib2.py.
746 def do_open(self, http_class, req):
747 host = req.get_host()
754 data = req.get_data()
755 h.putrequest(
'POST', req.get_selector())
756 if not req.headers.has_key(
'Content-type'):
757 h.putheader(
'Content-type',
758 'application/x-www-form-urlencoded')
759 if not req.headers.has_key(
'Content-length'):
760 h.putheader(
'Content-length',
'%d' % len(data))
762 h.putrequest(
'GET', req.get_selector())
763 except socket.error, err:
766 h.putheader(
'Host', host)
767 for args
in self.parent.addheaders:
769 for k, v
in req.headers.items():
775 code, msg, hdrs = h.getreply()
778 return addinfourl(fp, hdrs, req.get_full_url())
780 return self.parent.error(
'http', req, fp, code, msg, hdrs)
The documentation for this class was generated from the following file: