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

support content negotiation via Accept header #171

Open
FND opened this issue Apr 3, 2015 · 1 comment
Open

support content negotiation via Accept header #171

FND opened this issue Apr 3, 2015 · 1 comment

Comments

@FND
Copy link
Member

FND commented Apr 3, 2015

currently requesting an alternative representation requires a query parameter (e.g. ?format=json) - the same should be possible with an Accept header

I'd tried looking into this, but the current implementation is too primitive, providing insufficient infrastructure for a Clojure ignoramus like myself to get started:
https://github.com/innoq/statuses/blob/53d3186/src/statuses/routes.clj#L12
https://github.com/innoq/statuses/blob/53d3186/src/statuses/routes.clj#L33

@mvitz
Copy link
Contributor

mvitz commented Apr 3, 2015

routes.clj only contains the URI route patterns and functions for generating links inside statuses.
The routes statuses responds to can be found here. The last argument is the function which is called when a route is hit. E.g. hitting /statuses/info results in info being called.

A first starting point would be to check there for the Accept header and render the content in the matching format.

Hope this helps.

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

2 participants