-
• #2
You should be able to pass any kind of authorization in the
headers
of the options when making the HTTP call.You can for example check the sources of the android integration here:
https://github.com/espruino/BangleApps/blob/master/apps/android/boot.js#L310-L328So basically you should be able to make a POST call with authorization headers like this:
Bangle.http( 'http://example.com', { method: 'POST', headers: {Authorization: 'Bearer <your JWT>'} } )
(maybe you typed
header
instead ofheaders
or some other typo?)
Is there a way to pass an autherization header using the Bangle.http option?
I've tested passing this in as part of my POST, using the header option and also attempted to pass login creds via the URL I send the POST to but it isn't sent across.
I can pass the data via the Body as an alternative but wanted to check if autherization was supported in some way that I wasn't trying or if it's never passed with the request being sent out.