Package cherrypy :: Module _cpreqbody :: Class RequestBody
[hide private]
[frames] | no frames]

Class RequestBody

source code

object --+    
         |    
    Entity --+
             |
            RequestBody

The entity of the HTTP request.

Nested Classes [hide private]

Inherited from Entity: part_class

Instance Methods [hide private]
 
__init__(self, fp, headers, params=None, request_params=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
process(self)
Process the request entity based on its Content-Type.
source code

Inherited from Entity: __iter__, __next__, default_proc, fullvalue, make_file, next, read, read_into_file, readline, readlines

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  bufsize = 8192
The buffer size used when reading the socket.
  default_content_type = ''
This defines a default ``Content-Type`` to use if no Content-Type header is given.
  maxbytes = None
Raise ``MaxSizeExceeded`` if more bytes than this are read from the socket.

Inherited from Entity: attempt_charsets, charset, content_type, filename, fp, headers, length, name, params, parts, processors

Properties [hide private]

Inherited from Entity: type

Inherited from object: __class__

Method Details [hide private]

__init__(self, fp, headers, params=None, request_params=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

process(self)

source code 

Process the request entity based on its Content-Type.

Overrides: Entity.process

Class Variable Details [hide private]

default_content_type

This defines a default ``Content-Type`` to use if no Content-Type header is given. The empty string is used for RequestBody, which results in the request body not being read or parsed at all. This is by design; a missing ``Content-Type`` header in the HTTP request entity is an error at best, and a security hole at worst. For multipart parts, however, the MIME spec declares that a part with no Content-Type defaults to "text/plain" (see :class:`Part<cherrypy._cpreqbody.Part>`).

Value:
''