This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Donovan Preston (author)
Wed Jan 14 14:49:03 -0800 2009
pyhttp11 /
| name | age | message | |
|---|---|---|---|
| |
README | Wed Jan 14 14:49:03 -0800 2009 | |
| |
example.py | Wed Jan 14 14:49:03 -0800 2009 | |
| |
http11_parser.c | Wed Jan 14 14:49:03 -0800 2009 | |
| |
http11_parser.h | Wed Jan 14 14:49:03 -0800 2009 | |
| |
http11_parser.rl | Wed Jan 14 14:49:03 -0800 2009 | |
| |
http11_parser_common.rl | Wed Jan 14 14:49:03 -0800 2009 | |
| |
pyhttp11.c | Wed Jan 14 14:49:03 -0800 2009 | |
| |
setup.py | Wed Jan 14 14:49:03 -0800 2009 |
README
This is a Python binding for the C http11 parser from Ruby's Mongrel web server.
To build and install:
python setup.py install
To use:
import pyhttp11
h = pyhttp11.HttpParser()
print h.execute("POST http://foo.com/ HTTP/1.1\r\nHost: foo.com\r\nContent-length: 12\r\n\r\nHello, World")
print h.has_error()
print h.is_finished()
print h.environ
The h.environ dictionary will then be almost suitable for use as a wsgi environment dictionary, except for the following
changes which need to be made:
* Keys that start with HTTP_ have hyphens (-) like HTTP headers, not underscores (_) as required by the wsgi spec.
* The wsgi CONTENT_LENGTH is instead named HTTP_CONTENT-LENGTH
* There is no wsgi.input object with the correct semantics; the body is present in the environment dictionary as
REQUEST_BODY.
* There may be more inconsistencies; if you find any please let me know and I'll document them or fix them.
There is an example.py file that shows what typical usage of this module would look like. The example file requires
eventlet.
Donovan Preston
January 14, 2009







