Package wsgiwebapi :: Module wsgisupport :: Class HTTPMethodNotAllowed
[frames] | no frames]

Class HTTPMethodNotAllowed

source code

exceptions.Exception --+    
                       |    
          object --+   |    
                   |   |    
            Response --+    
                       |    
               HTTPError --+
                           |
                          HTTPMethodNotAllowed

Raise this exception if a method which is not allowed was used.
Instance Methods
 
__init__(self, request_method, allowed_methods)
Create a new Response object.
source code

Inherited from exceptions.Exception: __getitem__, __str__

Inherited from Response: get_encoded_header_list, set_content_type, set_unique_header

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Class Variables

Inherited from Response: VALID_STATUS_RE, status

Properties

Inherited from object: __class__

Method Details

__init__(self, request_method, allowed_methods)
(Constructor)

source code 

Create a new Response object.

The body defaults to being empty, the status defaults to "200 OK", and the content_type defaults to 'text/plain'.

  • body: The value to store in the body member. Defaults to ''.

  • status: The status to set for the response. May be specified as a number, or as a string (optionally, with a reason phrase). Defaults to 200.

  • content_type: The content type to set for the response (as specified for the set_content_type() method). Defaults to 'text/plain'.

Overrides: object.__init__
(inherited documentation)