Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 10 months ago.
Adding HTTP header using UbloxATCellularInterfaceExt
We need to add authorization headers like Authorization: Bearer xxxxxxxx
to the http requests using
ublox-at-cellular-interface-ext
Problem is we can find any ways to add the header
to the http profile.
As an alternative we tried to add the token to the url as a query but the length of query string seems to be restricted to 128 bytes. The long JWT tokens does not fit into this.
Does anyone have same problem ? Or am i missing something ?
Thanks :-)
Question relating to:
1 Answer
6 years, 10 months ago.
The feedback I've received is that this feature has been added in the SARA-G350-02S release (so not SARA-G350-00S or SARA-G350-01S). Additional custom HTTP headers can be added via the AT+UHTTP=<profile_id>,9,<custom_request_header>
command. The parameter <op_code> = 9
is what you would need to achieve his goal.
However, I don't have a C027 board with such a part fitted (which is why the driver doesn't currently support it) so it must be a very recent addition indeed. If you like I can try to find out if there are any C027 boards with the 02S part mounted (and also find out how you would specify that you wanted to purchase a C027 only if it had this variant)?
I've had a look at the AT command manual and it seems like you might be right, there isn't a way to add user-defined key/value pairs to the HTTP header being sent by the module. However, just to be sure, I'll see if I can hunt-down the relevant developers internally and check with them.
Can you let me know which flavour module you have?
posted by Rob Meades 08 Jan 2018Also did look at the AT command manual without luck.
We are developing on a C027 board with a SG-350 module,
I found this on the ublox forum https://forum.u-blox.com/index.php/13874/http-post-with-authentication-json-web-token-at-sara-u201?show=13874#q13874 but doesn't help when using the mbed cellular interface.
Added the following libraries to the project: https://mbed.org/teams/ublox/code/ublox-at-cellular-interface-ext/#44c7bbc84f42
https://developer.mbed.org/teams/ublox/code/ublox-cellular-base/#a15349fcab25 and
https://developer.mbed.org/teams/ublox/code/ublox-cellular-driver-gen/#a9eea2dbdd68
Guess the last lib is unnecessary.
As an alternative we could use the the PPP cellular interface but we need HTTPS and setting up mbed TLS on the C027 seems not possible. Although not sure with my limited knowledge of mbed TLS. But it seems the board cannot provide an entropy source.
Thanks for helping !
posted by Jens-Ole Graulund 08 Jan 2018The need for an entropy source can be #defined out if you wish but that leaves the issue of a shortage of RAM on the LPC1176 part. I have tried to get Mbed Client to fit but unfortunately it mallocs 34 kbytes of RAM when a maximum of 32 kbytes of mallocable RAM is available on that part.
posted by Rob Meades 09 Jan 2018Yes I remember hitting into this problem too. Guess another developer board setup is required to go down that road.
posted by Jens-Ole Graulund 09 Jan 2018