NativeRest - CallRestService header-attribute ApiKey gets transformed to apikey

0
On our native app we trigger a rest-call clientside using module NativeRest, javascript CallRestService. We need to send a header along for authentication of the calling scanner/phone. We create the header in the nanoflow like this: '{"Content-Type": "application/json", "ApiKey":"'+@ConnectorToMyPublishingApp.ApikeyMobileScanners+'"}' And we feed that header to the javascript call: What happens is that the attribute-name ‘ApiKey’ gets transformed to smallcaps: 'apikey’. This is not accepted by the publishing app. When we trigger the same call via SoapUI, it works like a charm. We tried a number of ways to write the name. 'Api-Key’ gives apiKey, '-Api-Key’ does not get accepted at all. Using Mendix 8.14.1    
asked
2 answers
1

Hi Tim,

This sounds like an issue in the underlying fetch implementation, see here:
https://stackoverflow.com/questions/34656412/fetch-sends-lower-case-header-keys

 

I would be more than happy to publish an update to the app store module that addresses this by using XMLHttpRequest or some other method if someone is willing to share their code with me.
 

answered
1

Hi Tim,

I released an update to the app store that addresses the issue. https://appstore.home.mendix.com/link/app/112178/

Let me know if everything works ok.

answered