web.py 2.0 documentation

http

HTTP Utilities (from web.py)


Functions

f prefixurl(base='') ...

Sorry, this function is really difficult to explain. Maybe some other time.

f expires(delta) ...

Outputs an Expires header for delta from now. delta is a timedelta object or a number of seconds.

f lastmodified(date_obj) ...

Outputs a Last-Modified header for datetime.

f modified(date=None, etag=None) ...

f redirect(url, status='301 Moved Permanently') ...

Returns a status redirect to the new URL. url is joined with the base URL so that things like `redirect("about") will work properly.

f found(url) ...

A 302 Found redirect.

f seeother(url) ...

A 303 See Other redirect.

f tempredirect(url) ...

A 307 Temporary Redirect redirect.

f write(cgi_response) ...

Converts a standard CGI-style string response into header and output calls.

f changequery(**kw) ...

Imagine you're at /foo?a=1&b=2. Then changequery(a=3) will return /foo?a=3&b=2 -- the same URL but with the arguments you requested changed.

f background(func) ...

A function decorator to run a long-running function as a background thread.

f backgrounder(func) ...

f profiler(app) ...

Outputs basic profiling information at the bottom of each response.

Classes

C Reloader(...) ...

Before every request, checks to see if any loaded modules have changed on disk and, if so, reloads them.

This class contains 3 members.

C reloader(...) ...

Before every request, checks to see if any loaded modules have changed on disk and, if so, reloads them.

This class contains 3 members.

See the source for more information.