-
Notifications
You must be signed in to change notification settings - Fork 326
Ergonomic content negotiation #27
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
Comments
@aturon did you mean an ability to route based on requested
Would be great to have more control over what I can return from one endpoint or for endpoints to be fine grained (not only path-based configuration). |
nancyfx has an interesting way to do content negotiation. https://github.com/NancyFx/Nancy/wiki/Content-Negotiation Get["/"] = parameters => {
return Negotiate
.WithModel(new RatPack {FirstName = "Nancy "})
.WithMediaRangeModel("text/html", new RatPack {FirstName = "Nancy fancy pants"})
.WithView("negotiatedview")
.WithHeader("X-Custom", "SomeValue");
}; |
We're recently merged a foundation for content negotation into |
Note from triage: there are several different things content-negotation might mean, and we probably want to support all of them.
We should survey the field, and come up with implementations. We already have all typed headers for these, so we can try implementations. |
What is the current state of this?
|
It seems the root issue here is that we're not implementing StructuralEq for |
Ah, it appears we actually can't implement Tracking issue on the compiler for this: rust-lang/rust#31434 |
Content negotiation is not (currently!) part of routing in Tide, but we should decide whether we want that to change, and if not, how to make it easy for an endpoint to internally perform content negotiation.
The text was updated successfully, but these errors were encountered: