diff -r 4df586851b0f Doc/library/asyncore.rst --- a/Doc/library/asyncore.rst Tue Feb 15 20:48:59 2011 +0100 +++ b/Doc/library/asyncore.rst Thu Feb 17 00:24:27 2011 +0100 @@ -282,7 +282,8 @@ asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.connect( (host, 80) ) - self.buffer = bytes('GET %s HTTP/1.0\r\n\r\n' % path, 'ascii') + self.buffer = bytes('GET %s HTTP/1.0\r\nHost: %s\r\n\r\n' % + (path, host), 'ascii') def handle_connect(self): pass @@ -301,8 +302,8 @@ self.buffer = self.buffer[sent:] - client = HTTPClient('www.python.org', '/') - asyncore.loop() + client = HTTPClient('www.python.org', '/') + asyncore.loop() .. _asyncore-example-2: