S
Size: a a a
s
def error_limiter(code=429):вот вывод:
return {'status': False,
'reason': 'REQUESTS_LIMIT',
'description': 'Number of allowed requests exceeded'
}, code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">в классе эндпоинта передаю так
<title>429 Too Many Requests</title>
<h1>Too Many Requests</h1>
<p>({'status': False, 'reason': 'REQUESTS_LIMIT', 'description': 'Number of allowed requests exceeded'}, <class 'api.Errors.ErrorMessage'>)</p>
{'Content-Type': 'text/html; charset=utf-8', 'Content-Length': '330', 'X-RateLimit-Limit': '1', 'X-RateLimit-Remaining': '0', 'X-RateLimit-Reset': '1638028093', 'Retry-After': '59', 'Server': 'Werkzeug/2.0.2 Python/3.9.2', 'Date': 'Sat, 27 Nov 2021 15:47:13 GMT'}
>>>
decorators = [limiter.limit('1/minute', error_message=error_limiter)]
пробовал черезmake_response(jsonify(JSON))
В
АВ

АВ
g(
МА
МА
МА