Update docs

This commit is contained in:
taoufik07
2019-02-26 17:01:13 +01:00
parent 854c6d3d65
commit b876f8484c
+8 -1
View File
@@ -235,12 +235,19 @@ Using ``before_request``
If you'd like a view to be executed before every request, simply do the following::
@api.route(before_request=True)
@api.before_request()
def prepare_response(req, resp):
resp.headers["X-Pizza"] = "42"
Now all requests to your HTTP Service will include an ``X-Pizza`` header.
For ``websockets``::
@api.before_request(websocket=True)
def prepare_response(ws):
await ws.accept()
WebSocket Support
-----------------