Now only returning the EmptyResponse object would do, no need to add the renderer related attributes: class SlackValidationMixin: # You can have your own rendered content here If you want to follow that route, a much easier and cleaner option would be to create a subclass of Response and return an empty dict from the render method e.g.: class EmptyResponse(rest_): You've added an answer, where you're setting the above mentioned attributes and then from the renderer returning an empty dict as response. Now it should be clear why you need the attributes with Response object - to get the renderer, media type and to pass any extra context that might be needed by the selected renderer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |