choose response format at request time #8428
-
Say I have a Controller method that returns a model object. Based on something in the request, e.g. a header value, I want to either respond with the default JSON, or use a view to render HTML. How could I do this? |
Beta Was this translation helpful? Give feedback.
Answered by
graemerocher
Nov 27, 2022
Replies: 1 comment
-
A http server filter is what I would do |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
edward3h
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A http server filter is what I would do