Sodaq SARA-R4 HTTPS request to Firebase

Hello.

I am trying to send POST request to Firebase platform, using the SARA-R410M 02B.

If someone is able to provide example code of successful POST request, I would be thrilled :slight_smile:
This is the sequence of AT commands I used:


at+uhttp=0,1,“us-central1-hds-test-1.cloudfunctions.net”
at+uhttp=0,6,1
at+uhttp=0,9,“0:content-type: application/x-www-form-urlencoded”
at+uhttpc=0,5,“us-central1-hds-test-1.cloudfunctions.net”,"",“name=Luka”,1


If someone has a clue what I’m doing wrong,
it would be perfect to find out my mistake is something at syntax side,
or something I am missing to do when using HTTPS.

Thank you!

1 Like

Hello,
If you did not solve your problem here what we did: use Sodaq_R4X libriary which can be found here https://github.com/SodaqMoja/Sodaq_R4X . They created some very nice handlers with sara r chips.
When we defined our constants constants we used this:
HttpHost = “your firebase header (provided by you in your comment)”
HttpPort = 80
HttpQuery = “/your function” (eg. /test)
you should receive the answer from the server and you need to interpret it.
Hope you found the solution or this will help

If the initial configuration is correct then you have at least one mistake on your uhttpc command:
at+uhttpc=0,5,"","",“name=luka”,1
in path you don’t put the url, you only put the path, for ex: say you want to post to us-central1-hds-test-1.cloudfunctions.net/post/here, you’d have in this case:
at+uhttpc=0,5,"/post/here","",“name=luka”,1