Error HTTP protocol (Server Zope 2.6.1) import httplib site="sandbox.rulemaker.net" conn = httplib.HTTPConnection(site) conn.set_debuglevel(3) headers={} conn.request("GET", "/ngps/Dist/m2crypto-0.11.zip","",headers) r = conn.getresponse() print "code ",r.status, r.reason, r.length while 1: data = r.read(8192) if not data: break print data r.close() conn.close() HOST = 'sandbox.rulemaker.net' # The remote host PORT = 80 # The same port as used by the server s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) s.send('GET /ngps/Dist/m2crypto-0.11.zip HTTP/1.1\r\nHost: sandbox.rulemaker.net\r\nAccept-Encoding: identity\r\n\r\n') data = s.recv(8092) print data s.close() response: HTTP/1.1 200 OK Server: Zope/(Zope 2.6.1 (source release, python 2.1, freebsd4)<CR><LF> , python 2.1.3, freebsd4) ZServer/1.1b1 Date: Mon, 15 Sep 2003 07:23:04 GMT Content-Type: application/zip Accept-Ranges: bytes Etag: Content-Length: 404629 Last-Modified: Mon, 23 Jun 2003 18:28:52 GMT There is an error in the 'Server' header line (<CR><LF> in string 'Server' line). httplib can't read the entire header. Regards, vincent jaulin.
participants (1)
-
vincent.jaulin@free.fr