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

Using header variables #53

Closed
lawicko opened this issue May 29, 2015 · 1 comment
Closed

Using header variables #53

lawicko opened this issue May 29, 2015 · 1 comment

Comments

@lawicko
Copy link

lawicko commented May 29, 2015

Hi, I need to serve different responses depending on the Accept-Language header sent by the client. How would I do this?
I know the header is available as variable #{HEADER_ACCEPT_LANGUAGE} but how do I rout to different json based on that? Can I use variables in the config.json? I'm assuming it needs to be defined somewhere in the config.json, but where exactly and how?

@pboos
Copy link
Contributor

pboos commented Sep 2, 2015

Totally different responses are not possible. But you can return the header variable. There is a way to do what you might want to do with languages (or at least I am guessing what you might want to do). You can set variables in config.json like "name_de". Then in the response you return #{name_#{HEADER_ACCEPT_LANGUAGE}}.

@pboos pboos closed this as completed Sep 12, 2017
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