[Python-checkins] CVS: python/dist/src/Lib httplib.py,1.16,1.17

Greg Stein python-dev@python.org
Mon, 26 Jun 2000 01:28:04 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv13852

Modified Files:
	httplib.py 
Log Message:
initial commit of a new HTTP library, supporting HTTP/1.1 and persistent
connections.



Index: httplib.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** httplib.py	2000/05/19 23:06:45	1.16
--- httplib.py	2000/06/26 08:28:01	1.17
***************
*** 1,34 ****
! """HTTP client class
! 
! See the following URL for a description of the HTTP/1.0 protocol:
! http://www.w3.org/hypertext/WWW/Protocols/
! (I actually implemented it from a much earlier draft.)
! 
! Example:
! 
! >>> from httplib import HTTP
! >>> h = HTTP('www.python.org')
[...1008 lines suppressed...]
--- 759,777 ----
      print
      print h.getfile().read()
! 
!     if hasattr(socket, 'ssl'):
!       host = 'www.c2.net'
!       hs = HTTPS()
!       hs.connect(host)
!       hs.putrequest('GET', selector)
!       hs.endheaders()
!       status, reason, headers = hs.getreply()
!       print 'status =', status
!       print 'reason =', reason
!       print
!       if headers:
!           for header in headers.headers: print string.strip(header)
!       print
!       print hs.getfile().read()