Table of Contents

Class: Request Twisted-0.19.0/twisted/protocols/http.py

A HTTP request.

Methods   
__init__
__repr__
_authorize
_cleanup
_sendError
addCookie
finish
getAllHeaders
getClient
getClientIP
getCookie
getHeader
getHost
getPassword
getRequestHostname
getUser
gotLength
handleContentChunk
isSecure
noLongerQueued
parseCookies
process
registerProducer
requestReceived
setHeader
setResponseCode
unregisterProducer
write
  __init__ 
__init__ (
        self,
        channel,
        queued,
        )

channel
the channel we're connected to. queued -- are we in the request queue, or can we start writing to the transport?
  __repr__ 
__repr__ ( self )

  _authorize 
_authorize ( self )

  _cleanup 
_cleanup ( self )

Called when have finished responding and are no longer queued.

  _sendError 
_sendError (
        self,
        code,
        resp='',
        )

  addCookie 
addCookie (
        self,
        k,
        v,
        expires=None,
        domain=None,
        path=None,
        max_age=None,
        comment=None,
        secure=None,
        )

Set an outgoing HTTP cookie.

In general, you should consider using sessions instead of cookies, see twisted.web.server.Resource.getSession and the twisted.web.server.Session class for details.

  finish 
finish ( self )

We are finished writing data.

  getAllHeaders 
getAllHeaders ( self )

  getClient 
getClient ( self )

  getClientIP 
getClientIP ( self )

  getCookie 
getCookie ( self,  key )

Get a cookie that was sent from the network.

  getHeader 
getHeader ( self,  key )

Get a header that was sent from the network.

  getHost 
getHost ( self )

Get my originally requesting transport's host.

Don't rely on the transport attribute, since Request objects may be copied remotely. For information on this method's return value, see twisted.internet.tcp.Port.

  getPassword 
getPassword ( self )

  getRequestHostname 
getRequestHostname ( self )

Get the hostname that the user passed in to the request.

This will either use the Host: header (if it is available) or the

  getUser 
getUser ( self )

  gotLength 
gotLength ( self,  length )

  handleContentChunk 
handleContentChunk ( self,  data )

Write a chunk of data.

  isSecure 
isSecure ( self )

  noLongerQueued 
noLongerQueued ( self )

Notify the object that it is no longer queued.

We start writing whatever data we have to the transport, etc.

Exceptions   
RuntimeError, "noLongerQueued() got called unnecessarily."
  parseCookies 
parseCookies ( self )

  process 
process ( self )

Override in subclasses.

  registerProducer 
registerProducer (
        self,
        producer,
        streaming,
        )

Register a producer.

  requestReceived 
requestReceived (
        self,
        command,
        path,
        version,
        )

Called by channel when all data has been received.

  setHeader 
setHeader (
        self,
        k,
        v,
        )

Set an outgoing HTTP header.

  setResponseCode 
setResponseCode (
        self,
        code,
        message=None,
        )

Set the HTTP response code.

  unregisterProducer 
unregisterProducer ( self )

Unregister the producer.

  write 
write ( self,  data )

Write some data as a result of an HTTP request. The first time this is called, it writes out response data.


Table of Contents

This document was automatically generated on Sun Jul 14 19:52:57 2002 by HappyDoc version 2.0