Parametrizable Custom HTTP header Key (REST) - Mendix Forum

Parametrizable Custom HTTP header Key (REST)

3

It should be possible to parametrize the key of a custom HTTP header to increase flexibility and configurability.

image.png

 

Edit: it would be handy to be able to add more custom headers at runtime in case they were not known yet during design time.

asked
4 answers

For example this API:

https://cloud.google.com/storage/docs/xml-api/reference-headers#xgoogmeta

Created

@Andrej Koelewijn I have seen instances where a system that publishes a REST API requires different header keys depending on environment (e.g. Test/Acceptance/Production). In another instance the target API required the presence of a header in a specific scenario, but fails if the same header is provided in another scenario - for the same endpoint.

 

Unfortunately these are not public facing API's so I cannot share the details. 

 

Not being able to provide a list of headers as input parameter to the rest call is also one of the few remaining missing features to build a generic module/functionality to implement common functions like logging/monitoring/automated retry for multiple consumed REST API's in a single app. 

 

I know it's possible to write a custom Java action to achieve the intended result, but a platform supported way of implementing even more flexible REST calls would be awesome !

 

PS I could also live with a Java action in Communitycommons module, as long as its platform supported and is updated in case the Java API is changed...

Created

With OData you can add and pass on eg. an X-APIKey as header from a configurable list. You can change this at runtime. For the REST service, you have to configure this during the design time. You have to know which headers you will need in advance and will potentially need to go through REST calls to adjust them in Studio Pro. At the moment, you can just set a value from a configuration dynamically. Wouldn't it make more sense to be able to configure Key-Value pairs for a header entry?

Created

Can you give an example use case how you would use this, e.g., a public api that requires this?

Created