Ejemplo n.º 1
0
def send_error(status, type='', message=''):
    error = {'error': type}
    if message:
        error["message"] = message
    response = make_response(send_json(error))
    response.status_code = status
    return response
Ejemplo n.º 2
0
def send_error(status, type='', message=''):
    error = {'error' : type}
    if message:
        error["message"] = message
    response = make_response(send_json(error))
    response.status_code = status
    return response
Ejemplo n.º 3
0
def send_response(obj=None, status=200, etag=None):
    if not obj:
        response = make_response('')
    else:
        response = make_response(send_json(obj))
    if etag:
        response.set_etag(etag)
    response.status_code = status
    return response
Ejemplo n.º 4
0
def send_response(obj=None, status=200, etag=None):
    if not obj:
        response = make_response('')
    else:
        response = make_response(send_json(obj))
    if etag:
        response.set_etag(etag)
    response.status_code = status
    return response