HTTP 1.0 or 1.1 ?

A printers at sendme.cz
Fri Nov 1 16:37:40 EST 2002


Hi,
I use httplib for HTTP 1.0 .It worked well until today.
When I use 
#############
h = httplib.HTTP(self.server)
h.putrequest("POST", PostingString)
h.putheader("Content-type", "application/x-www-form-urlencoded")
h.putheader('User-Agent','Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90')
h.putheader('Host', self.server)
h.putheader("Content-length", "%d" % len(params))
h.putheader('Accept', 'text/plain')
h.endheaders()
h.send(params)
self.reply, self.msg, self.hdrs = h.getreply()
#############

self.reply returns -1 and self.hdrs is NONE.
Through a sniffer I,however, found out that server's response was

[107 byte(s) of data]
 HTTP/1.1 200OK 
 Server: Microsoft-IIS/4.0 
 Date: Fri, 01 Nov 2002 20:59:46 GMT
 Content-type: text/html


Does it mean I can not get headers through HTTP 1.0 ???
And what does self.reply = -1  mean?

Thanks for help.
Ladislav








More information about the Python-list mailing list