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

make .:format optional, fall back to default serializer #1

Open
27escape opened this issue Jul 15, 2010 · 1 comment
Open

make .:format optional, fall back to default serializer #1

27escape opened this issue Jul 15, 2010 · 1 comment

Comments

@27escape
Copy link

If a path that specified a .:format option is matched

get '/user_info/:userid.:format => sub {}

I would also like to get the default serializer with additionally using
get '/user_info/:userid => sub {}

maybe we could have
get '/user_info/:userid(.:format)? => sub {}

thank you

@leejo
Copy link

leejo commented Jan 20, 2012

I've done this by using the Content-Type in the request header:

leejo/Dancer-Plugin-REST@67044ff6085e8daa82a2c98ab02953f036ab10d8 (N.B. relies on leejo/Dancer@d286c2c975c29e77887a37869f8050039def4157 for clean test run). Would this be a useful alternative - you can use: get '/user_info/:userid' => sub {} as your route and then set, for example, "Content-Type: application/json" in your header to get a json response back

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