You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How about extending Controller methods which return Response object with headers parameter?
Some practical use cases are:
pass X-Total-Page and other pagination headers with response
pass cache headers like ETag and Last-Modified
...
defaccepted(self, message: MessageType=None, headers=None) ->Response:
""" Returns an HTTP 202 Accepted response, with optional message; sent as plain text or JSON. """returnaccepted(message, headers=None)
defno_content(self, headers=None) ->Response:
""" Returns an HTTP 204 No Content response. """returnno_content(headers=None)
...
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How about extending
Controller
methods which returnResponse
object withheaders
parameter?Some practical use cases are:
Beta Was this translation helpful? Give feedback.
All reactions