Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to set the content-type dynamically inside the handler? #879

Open
makkalot opened this issue Jan 6, 2021 · 0 comments
Open

Comments

@makkalot
Copy link

makkalot commented Jan 6, 2021

I'm having this interesting issue where I have this handler which returns json normally but on certain condition there's requirement where I need to return html response back. Therefore in my handler I need to figure out when to return json and when to return html response. I naively tried :

response.status = HTTP_OK       
response.content_type = 'text/html'

but seems the output formatters are overriding this. Any ideas how to solve it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant