urlrelay 0.7.1

RESTful WSGI URL dispatcher.

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!
send us
an update
LICENSE TYPE:
BSD License 
USER RATING:
UNRATED
  0.0/5
DEVELOPED BY:
L. C. Rees
HOMEPAGE:
pypi.python.org
CATEGORY:
ROOT \ Internet \ HTTP (WWW)
urlrelay is a simple URL dispatcher that passes HTTP requests to a WSGI application based on a matching URL path regex pattern and an optional HTTP request method.
Usage example: #!/bin/env python

import urlrelay

# Simple URL to application mapping
urlrelay.url('^/$')
def index(environ, start_response):
start_response('200 OK', [('Content-type', 'text/plain')])
return ['Home Page']

# "RESTful" URL to application mapping
urlrelay.url('^/hello_world$', 'GET')
def hello_world(environ, start_response):
start_response('200 OK', [('Content-type', 'text/plain')])
return ['Hello World']

# URL to on-disk application mapping
# urlrelay.register('^/ondisk$', 'module.on_disk')

if __name__ == '__main__':
from wsgiref.simple_server import make_server
http = make_server('', 8080, urlrelay.URLRelay())
http.serve_forever()

Last updated on January 15th, 2009

requirements

#URL dispatcher #HTTP request parser #regex pattern #Python #WSGI #URL #HTTP

Add your review!

SUBMIT