HTTP/1.1 support in 1.5? 
Author Message
 HTTP/1.1 support in 1.5?

  JPS> I've seen an updated httplib.py floating around, but it's not
  JPS> in the standard distribution.  I know it supported HTTP/1.1
  JPS> (very important), and as I remember had some new classes and/or
  JPS> functions for using HTTP.  Is this planned to be in the 1.5
  JPS> final?  -- "Green Tony squeeled and I'm off to Galaxy X" .jPS

I started a complete re-write of httplib so that it would be easy to
write clients, servers, and proxies for http/1.1.  I didn't get very
far before I ran out of time to work on it.  I had hoped to finish it
and propose it for inclusion in 1.5, but never got farther than
hoping.

Perhaps someone is interested in picking this up.  (If there was some
interest, I could probably contribute some starting in January.) I
think the abstractions are a better match for a lot of low-level HTTP
programming -- objects include Connections, PersistentConnections,
Requests, and Responses.  There is also some code for reading chunked
entity bodies.

There are some minor, but annoying things that need to be fixed.  Most
important is probably changing from regex to re, so that I can't get
rid of the messy stuff I did to use threads and regular expressions.

Jeremy



Tue, 23 May 2000 03:00:00 GMT  
 HTTP/1.1 support in 1.5?

Quote:

> I started a complete re-write of httplib so that it would be easy to
> write clients, servers, and proxies for http/1.1.  I didn't get very
> far before I ran out of time to work on it.  I had hoped to finish it
> and propose it for inclusion in 1.5, but never got farther than
> hoping.

> Perhaps someone is interested in picking this up.  (If there was some
> interest, I could probably contribute some starting in January.) I
> think the abstractions are a better match for a lot of low-level HTTP
> programming -- objects include Connections, PersistentConnections,
> Requests, and Responses.  There is also some code for reading chunked
> entity bodies.

> There are some minor, but annoying things that need to be fixed.  Most
> important is probably changing from regex to re, so that I can't get
> rid of the messy stuff I did to use threads and regular expressions.

Would an acceptable (read: minimal) solution like changing:

old: HTTP_VERSION = 'HTTP/1.0'

new: HTTP_VERSION = 'HTTP/1.[0-9]'

work enough that current httplib.py users aren't blocked from reading HTTP/1.1
sites (like Fedex.com for example)?  I don't know enough personally about the
underpinnings of HTTP, all I know is that this change did allow me access to
1.1 sites.

--
"Green Tony squeeled and I'm off to Galaxy X"

                     http://www.digicool.com/



Tue, 23 May 2000 03:00:00 GMT  
 HTTP/1.1 support in 1.5?

Quote:
> Would an acceptable (read: minimal) solution like changing:

> old: HTTP_VERSION = 'HTTP/1.0'

> new: HTTP_VERSION = 'HTTP/1.[0-9]'
> work enough that current httplib.py users aren't blocked from
> reading HTTP/1.1 sites (like Fedex.com for example)?  I don't know
> enough personally about the underpinnings of HTTP, all I know is
> that this change did allow me access to 1.1 sites.

Of course, this has already been taken care of in the 1.5b1
distribution.  (The patch for 1.4 has been floating around for nearly
a year too!

--Guido van Rossum (home page: http://www.python.org/~guido/)



Tue, 23 May 2000 03:00:00 GMT  
 HTTP/1.1 support in 1.5?


Quote:

> Would an acceptable (read: minimal) solution like changing:

> old: HTTP_VERSION = 'HTTP/1.0'

> new: HTTP_VERSION = 'HTTP/1.[0-9]'

> work enough that current httplib.py users aren't blocked from reading HTTP/1.1
> sites (like Fedex.com for example)?  I don't know enough personally about the
> underpinnings of HTTP, all I know is that this change did allow me access to
> 1.1 sites.

In 1.5b1 httplib.py only uses HTTP_VERSION for the version to send in
the request.  So don't change it to a regular expression (or you'll be
sending a version 1.[0-9] request)!

Quote:
>>> h = httplib.HTTP('www.fedex.com')
>>> h.putrequest('GET', '/')
>>> h.endheaders()
>>> h.getreply()

(200, 'OK', <Message instance at ccbe0>)

An HTTP/1.1 server should honor a request for HTTP/1.0, so you
shouldn't need to change the library at all.  If you want to do
HTTP/1.1 with persistent connections, chunked responses, etc. then you
will lose completely with the current implementation.

Jeremy



Tue, 23 May 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. HTTP 1.1 support in BaseHTTPServer [patch 430706]

2. httplib supporting HTTP/1.1 [Q]

3. How should HTTP 1.1 support become available?

4. Need HTTP 1.1 support in TCL

5. Difference between version 1.1 & 1.5 of dBase

6. ExtensionClass 1.1 binary release for Windows NT/95 and Python 1.5

7. HTTP 1.0 and HTTP 1.1 packages

8. New Templates: the Internet Framework Templates - HTTP Server Edition Version 1.5

9. HTTP/1.1 server in Python

10. HTTP 1.1 anyone?

11. HTTP/1.1 module

12. HTTP/1.1 BaseHTTPServer

 

 
Powered by phpBB® Forum Software