Logo Search packages:      
Sourcecode: ajaxterm version File versions  Download package

Classes | Public Member Functions | Public Attributes

qweb::QWebRequest Class Reference

List of all members.

Classes

class  HttpHeaders

Public Member Functions

def __init__
def __iter__
def debug
def echo
def get_full_url
def http_404
def http_download
def http_redirect
def load_post_data
def response
def save_files
def write

Public Attributes

 buffer
 DATA
 environ
 FILES
 FILES_LIST
 FULL_PATH
 FULL_URL
 GET
 GET_LIST
 PATH_INFO
 php
 POST
 POST_LIST
 REQUEST
 request_cookies
 REQUEST_LIST
 REQUEST_URI
 response_cookies
 response_gzencode
 response_headers
 response_started
 response_status
 SCRIPT_NAME
 SESSION
 start_response

Detailed Description

QWebRequest a WSGI request handler.

QWebRequest is a WSGI request handler that feature GET, POST and POST
multipart methods, handles cookies and headers and provide a dict-like
SESSION Object (either on the filesystem or in memory).

It is constructed with the environ and start_response WSGI arguments:

  req=qweb.QWebRequest(environ, start_response)

req has the folowing attributes :

  req.environ standard WSGI dict (CGI and wsgi ones)

Some CGI vars as attributes from environ for convenience: 

  req.SCRIPT_NAME
  req.PATH_INFO
  req.REQUEST_URI

Some computed value (also for convenience)

  req.FULL_URL full URL recontructed (http://host/query)
  req.FULL_PATH (URL path before ?querystring)

Dict constructed from querystring and POST datas, PHP-like.

  req.GET contains GET vars
  req.POST contains POST vars
  req.REQUEST contains merge of GET and POST
  req.FILES contains uploaded files
  req.GET_LIST req.POST_LIST req.REQUEST_LIST req.FILES_LIST multiple arguments versions
  req.debug() returns an HTML dump of those vars

A dict-like session object.

  req.SESSION the session start when the dict is not empty.

Attribute for handling the response

  req.response_headers dict-like to set headers
  req.response_cookies a SimpleCookie to set cookies
  req.response_status a string to set the status like '200 OK'

  req.write() to write to the buffer

req itselfs is an iterable object with the buffer, it will also also call
start_response automatically before returning anything via the iterator.

To make it short, it means that you may use

  return req

at the end of your request handling to return the reponse to any WSGI
application server.

Definition at line 915 of file qweb.py.


The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index