This commit is contained in:
taoufik07
2019-02-26 23:46:07 +01:00
parent a04d7c3a9a
commit 885d902b7d
+2 -2
View File
@@ -235,7 +235,7 @@ Using ``before_request``
If you'd like a view to be executed before every request, simply do the following::
@api.before_request()
@api.route(before_request=True)
def prepare_response(req, resp):
resp.headers["X-Pizza"] = "42"
@@ -243,7 +243,7 @@ Now all requests to your HTTP Service will include an ``X-Pizza`` header.
For ``websockets``::
@api.before_request(websocket=True)
@api.route(before_request=True, websocket=True)
def prepare_response(ws):
await ws.accept()