pythings / Drivers

Some drivers for MicroPython
Apache License 2.0
63 stars 22 forks source link

A way to edit headers for HTTP requests? #12

Open Tylersuard opened 3 years ago

Tylersuard commented 3 years ago

Hello, thank you for making this code. It is the only thing I've found to work on the TTGO T-call. Is there a way to edit headers for the http requests using the modem.request method? I need to add a key to my API call. Thank you!

sarusso commented 3 years ago

There is a way but requires some work. You have to edit the code to support the (Sicom proprietary) AT+SHAHEAD command. Something like it is done here (in this case to add support for setting APN username and password): https://github.com/pythings/Drivers/issues/9#issuecomment-825074289

See here for more info about the AT+SHAHEAD command: https://m2msupport.net/m2msupport/atshahead-set-up-http-headers-in-the-simcom-modules/

Disclaimer: haven't tried it!