jvalue / ods

Open Data Service - Make consuming open data easy, safe, and reliable
GNU Affero General Public License v3.0
36 stars 23 forks source link

Specify custom headers for HTTP import #321

Open sonallux opened 3 years ago

sonallux commented 3 years ago

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:


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 commented 3 years ago

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

sonallux commented 3 years ago

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 commented 3 years ago

Makes sense!