'Get a method handler for this request
@param method: the method name
@param transform: get handler for transformable data format
@return: the method handler'

def get_handler(self, method, transform=False):

    handlers = self._handlers
    http_hooks = handlers.get(self.http)
    if (not http_hooks):
        return None
    DEFAULT_REPRESENTATION = self.DEFAULT_REPRESENTATION
    hooks = http_hooks.get(DEFAULT_REPRESENTATION)
    if hooks:
        method_hooks = dict(hooks)
    else:
        method_hooks = {}
    representation = ('__transform__' if transform else self.representation)
    if (representation and (representation != DEFAULT_REPRESENTATION)):
        hooks = http_hooks.get(representation)
        if hooks:
            method_hooks.update(hooks)
    if (not method):
        methods = (None,)
    else:
        methods = (method, None)
    for m in methods:
        handler = method_hooks.get(m)
        if (handler is not None):
            break
    if isinstance(handler, (type, types.ClassType)):
        return handler()
    else:
        return handler
