Table of Contents

Class: Request | Twisted-0.17.4/twisted/protocols/http.py
--- | ---

A HTTP request.

Methods |
--- | ---

__init__ _authorize _cleanup _endHeaders _sendError _sendHeader _sendStatus addCookie finish getAllHeaders | getClient getClientIP getCookie getHeader getHost getPassword getRequestHostname getUser gotLength handleContentChunk | noLongerQueued parseCookies prePathURL 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?

| _authorize

    _authorize ( self )

| _cleanup

    _cleanup ( self )

Called when have finished responding and are no longer queued.

| _endHeaders

    _endHeaders ( self )

Finished sending headers.

| _sendError

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

| _sendHeader

    _sendHeader (
            self,
            name,
            value,
            )

Send a header.

| _sendStatus

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

Send a status code.

| 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 self.getSession and the 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.

| 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 )

| prePathURL

    prePathURL ( 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 )

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 Sat Apr 20 01:31:04 2002 by HappyDoc version 2.0