Accept header based routing #2888
jason-johnson
started this conversation in
Ideas
Replies: 1 comment 6 replies
-
I'm sorry but I'm still not at all following. It sounds like you're not interested so much in supporting multiple input formats, but only multiple output formats, is that much correct? Can you show an example snippet of how the API you've written so far would be used? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Related to issue #1654
I am trying to create a crate as described in that discussion (gist is here). The strategy works to route based on the content type but one problem is that this crate is doing RFC compliant negotiation of the Accept header vs. what the server can produce but does not have a way to pass the resulting media type to the handler or to set the content type. I modified the
call
function to set the content-type header but he handler still needs a way to see it because it may chose different rendering based on this negotiated media type (e.g. a type with a json subtype). Of course the handler could simply use an extractor to get the Accept header and do the negotiation but that would be a shame since the MediaTypeHandler crate is already doing that.Beta Was this translation helpful? Give feedback.
All reactions