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

Specify custom headers for HTTP import #321

Open
sonallux opened this issue Feb 13, 2021 · 3 comments
Open

Specify custom headers for HTTP import #321

sonallux opened this issue Feb 13, 2021 · 3 comments

Comments

@sonallux
Copy link
Contributor

Currently, it is not possible to set custom headers for the HTTP import. It would be cool if the ODS does support setting custom headers, because there are plenty of use cases for HTTP headers:

  • response format: A datasource might support multiple response formats. The format is often selected based on the Accept request header.
  • localization via the Accept-Language header
  • authorization via the Authorization header. Of course, this would then be no real open data. But for example many public transport providers to allow accessing their data (e.g. timetable, station information, delays, ...) with an access token, that is provided after registration.
  • other custom headers

I am currently adjusting my fault tolerance tests and instead of setting up a custom mock server to perform imports against. I wanted the import to be performed against the adapter itself and query the list of datasources. Unfortunately, the adapter returns XML when not specify the Accept header. This is not a big issue for me, because I can use the XML interpreter to transform it back to JSON. But this has some limitations because the output JSON is slightly different (e.g. numbers and booleans are present as strings, ...). That's why I came up with the idea of adding support for setting custom HTTP headers for the import.

@georg-schwarz
Copy link
Member

Very cool idea, I like it!
Probably to be implemented as generic key value pairs?

@sonallux
Copy link
Contributor Author

Probably to be implemented as generic key value pairs?

Yes exactly. Might also be worth to enable support for custom headers not just inside the static datasource configuration, but also as dynamic runtime parameters.

@georg-schwarz
Copy link
Member

Makes sense!

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