Re: Standalone HTTP parser?



Christopher Stawarz wrote:
Does anyone know of a standalone module for parsing and generating HTTP messages? I'm looking for something that will take a string and return a convenient message object, and vice versa. All the Python HTTP parsing code I've seen is either intimately bound to the corresponding socket I/O operations (e.g. httplib, httplib2, BaseHTTPServer) and/or buried in somebody's framework (e.g. Twisted).

I want to write some HTTP servers/clients that do asynchronous I/O using my own engine (multitask), so I need a HTTP package that won't insist on doing the I/O for me.

Look at rfc822 or the email module - HTTP responses are in the same format, modulo the first line status. Requests too, though with a different format for the first line.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get on the web: Blog, lens and tag your way to fame!!
holdenweb.blogspot.com squidoo.com/pythonology
tagged items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------

.



Relevant Pages

  • Re: Listening to HTTP requests from a process
    ... Are there any ways i can listen and log all HTTP messages from a ... launches a process and then listens to any HTTP requests sent from ... some data from that request. ... I have looked into HTTP listener but HTTP listener API's do not allow ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Standalone HTTP parser?
    ... HTTP messages? ... corresponding socket I/O operations (e.g. httplib, httplib2, ... I want to write some HTTP servers/clients that do asynchronous I/O ...
    (comp.lang.python)
  • Re: Listening to HTTP requests from a process
    ... Are there any ways i can listen and log all HTTP messages from a ... launches a process and then listens to any HTTP requests sent from ... some data from that request. ... I have looked into HTTP listener but HTTP listener API's do not allow ...
    (microsoft.public.dotnet.languages.csharp)
  • Listening to HTTP requests from a process
    ... Are there any ways i can listen and log all HTTP messages from a ... launches a process and then listens to any HTTP requests sent from ... I am interested in one such request as i have to parse ... I have looked into HTTP listener but HTTP listener API's do not allow ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: http problem
    ... that sites seems to need the User-Agent http header. ... So I send a http request (I have tried to send it exactly> like Internet Explorer does - I have copied a GET request from http> peek monitor) I get access denied message - there is something about> digidefence.com in there. ... > I wonder what Internet Explorer is doing more then sending> straight http messages. ...
    (microsoft.public.win32.programmer.networks)