Package ganeti :: Package http :: Module server :: Class HttpServerHandler
[hide private]
[frames] | no frames]

Class HttpServerHandler

source code


Base class for handling HTTP server requests.

Users of this class must subclass it and override the HandleRequest function.

Instance Methods [hide private]
 
PreHandleRequest(self, req)
Called before handling a request.
source code
 
HandleRequest(self, req)
Handles a request.
source code

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

Static Methods [hide private]
tuple; (string, string)
FormatErrorMessage(values)
Formats the body of an error message.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

PreHandleRequest(self, req)

source code 

Called before handling a request.

Can be overridden by a subclass.

HandleRequest(self, req)

source code 

Handles a request.

Must be overridden by subclass.

FormatErrorMessage(values)
Static Method

source code 

Formats the body of an error message.

Parameters:
  • values (dict) - dictionary with keys code, message and explain.
Returns: tuple; (string, string)
Content-type and response body