ESP32 json patch data with auth

stoyanoff
Posts: 1
Joined: Wed Dec 06, 2023 11:25 am

ESP32 json patch data with auth

Postby stoyanoff » Wed Dec 06, 2023 11:33 am

Greetings! I am building my own system and I am using ESP32. So my database is firebase and I have authentication activated. So I am recieving a token by email and password. So in this case if I add this token to the url it becomes quite long. So I am using AT+HTTPURLCFG to set the long url. But in this case I can`t put data to the database. This is a simple example:
If I don`t use auth my command looks like this :

Code: Select all

AT+HTTPCPUT="https://mybase-default-rtdb.europe-west1.firebasedatabase.app/home/params.json",18,2,"connection: keep-alive","content-type: application/json"

data={"Update":"45fs4"}
But if I add ?auth={token} to the url and when I call

Code: Select all

AT+HTTPCPUT="",18,2,"connection: keep-alive","content-type: application/json"
data={"Update":"45fs4"}
it returns SEND FAIL.
It seems the long token somehow disturbs this function.
How do you achieve data patch with auth?
Thanks!

Who is online

Users browsing this forum: No registered users and 96 guests