(handler, defaults, callback)
Makes a call to an API endpoint, using parameters from default.
Makes a call to an API endpoint, using parameters from default.
Makes a call to an API endpoint using parameters from default .
def get_endpoint(handler, defaults, callback):
    '''
    Makes a call to an API endpoint, using parameters from default.
    '''
    try:
        args = {}
        for name, default, parser in defaults:
            arg = handler.get_argument(name, default=None)
            if arg is None:
                args[name] = default
            else:
                args[name] = parser(arg)
        handler.write(callback(**args))
    except Exception as e:
        handler.write(api.exception_response(e))
def get_endpoint ( handler , defaults , callback ) : try : args = { } for name , default , parser in defaults : arg = handler . get_argument ( name , default = None ) if arg is None : args [ name ] = default else : args [ name ] = parser ( arg ) handler . write ( callback ( * * args ) ) except Exception as e : handler . write ( api . exception_response ( e ) )