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

Use content-type header for response #185

Open
neksodebe opened this issue Apr 27, 2023 · 2 comments
Open

Use content-type header for response #185

neksodebe opened this issue Apr 27, 2023 · 2 comments
Labels
⚡ type: enhancement An issue or pull request that aims to improve an existing feature

Comments

@neksodebe
Copy link

I'm trying to make a custom quote message in my .bashrc file, but each response is JSON. I tried setting the Content-Type header to text/html, but no luck.

My feature request

Change the response based on Content-Type.

Example

The example route is /quotes/random

If Content-type is text/html, instead of returning

[{"_id":"_dfC0aL_AGD4","content":"Great ideas often receive violent opposition from mediocre minds.","author":"Albert Einstein","tags":["Famous Quotes","Technology"],"authorSlug":"albert-einstein","length":65,"dateAdded":"2019-08-03","dateModified":"2023-04-14"}]

return

"Great ideas often receive violent opposition from mediocre minds." - Albert Einstein
@neksodebe neksodebe added the ⚡ type: enhancement An issue or pull request that aims to improve an existing feature label Apr 27, 2023
@neksodebe
Copy link
Author

Either Content-Type or Accept

@a2937
Copy link

a2937 commented Oct 28, 2023

That output makes sense for it to be a plain text content type rather than HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚡ type: enhancement An issue or pull request that aims to improve an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants