Table of Contents

Class: BaseResponse Zope-2.2.1-src/lib/python/ZPublisher/BaseResponse.py

Base Response Class

What should be here?

Methods   
__getitem__
__init__
__repr__
__str__
appendBody
badRequestError
debugError
exception
flush
forbiddenError
getBody
getHeader
getStatus
notFoundError
outputBody
setBody
setCookie
setHeader
setStatus
unauthorized
write
  __getitem__ 
__getitem__ ( self,  name )

Get the value of an output header

  __init__ 
__init__ (
        self,
        stdout,
        stderr,
        body='',
        headers=None,
        status=None,
        cookies=None,
        )

  __repr__ 
__repr__ ( self )

  __str__ 
__str__ ( self )

  appendBody 
appendBody ( self,  body )

  badRequestError 
badRequestError ( self,  v='' )

Raise an error indicating something wrong with the request

Exceptions   
'Bad Request'
  debugError 
debugError ( self,  v='' )

Raise an error with debigging info and in debugging mode

Exceptions   
'Debug Error'
  exception 
exception (
        self,
        fatal=0,
        info=None,
        )

Handle an exception.

The fatal argument indicates whether the error is fatal.

The info argument, if given should be a tuple with an error type, value, and traceback.

  flush 
flush ( self )

  forbiddenError 
forbiddenError ( self,  v='' )

Raise an error indicating that the request cannot be done

Exceptions   
'Forbidden'
  getBody 
getBody ( self )

Returns a string representing the currently set body.

  getHeader 
getHeader ( self,  name )

Get a header value

Returns the value associated with a HTTP return header, or "None" if no such header has been set in the response yet.

  getStatus 
getStatus ( self )

Returns the current HTTP status code as an integer.

  notFoundError 
notFoundError ( self,  v='' )

Generate an error indicating that an object was not found.

Exceptions   
'Not Found'
  outputBody 
outputBody ( self )

Output the response body

  setBody 
setBody ( self,  body )

  setCookie 
setCookie (
        self,
        name,
        value,
        **kw,
        )

Set an HTTP cookie on the browser

The response will include an HTTP header that sets a cookie on cookie-enabled browsers with a key "name" and value "value". This overwrites any previously set value for the cookie in the Response object.

  setHeader 
setHeader (
        self,
        name,
        value,
        )

  setStatus 
setStatus (
        self,
        status,
        reason=None,
        )

  unauthorized 
unauthorized ( self )

Raise an eror indicating that the user was not authizated

Make sure to generate an appropriate challenge, as appropriate.

Exceptions   
'Unauthorized'
  write 
write ( self,  data )

Return data as a stream

HTML data may be returned using a stream-oriented interface. This allows the browser to display partial results while computation of a response to proceed.

The published object should first set any output headers or cookies on the response object.

Note that published objects must not generate any errors after beginning stream-oriented output.


Table of Contents

This document was automatically generated on Mon Sep 4 07:33:06 2000 by HappyDoc version r0_6