def register_method(self, method, fn):
        """Register an HTTP method and handler function.

        :param method: string, HTTP verb
        :param fn: python function handling the request
        :raises: RouteAlreadyRegisteredError if the route is already registered
        :returns: n/a
        """

        # ensure the HTTP verb is not already registered
        if method not in self.methods.keys():
            logger.debug('Service Router ({0} - {1}): Adding method {2} on '
                         'route {3}'
                         .format(id(self),
                                 self.service_name,
                                 method,
                                 self.uri))
            self.methods[method] = fn

        else:
            raise RouteAlreadyRegisteredError(
                'Service Router ({0} - {1}): Method {2} already registered '
                'on Route {3}'
                .format(id(self),
                        self.service_name,
                        method,
                        self.uri))
def register_method ( self , method , fn ) : if method not in self . methods . keys ( ) : logger . debug ( 'Service Router ({0} - {1}): Adding method {2} on ' 'route {3}' . format ( id ( self ) , self . service_name , method , self . uri ) ) self . methods [ method ] = fn else : raise RouteAlreadyRegisteredError ( 'Service Router ({0} - {1}): Method {2} already registered ' 'on Route {3}' . format ( id ( self ) , self . service_name , method , self . uri ) )
Register an HTTP method and handler function.

        :param method: string, HTTP verb
        :param fn: python function handling the request
        :raises: RouteAlreadyRegisteredError if the route is already registered
        :returns: n/a