Is it possible to push a data structure like this to the RTDB without using two POST requests?
{
"temp": {
"POST-ID": {
"value": 30,
"timestamp": {".sv": "timestamp"}
}
},
"weight": {
"POST-ID": {
"value": 123,
"timestamp": {".sv": "timestamp"}
}
}
}
Where the POST-ID would be the unique-id (e.g. "-JSOpn9ZC54A4P4RoqVa") generated with a POST request.
I am basically looking to have a combination of POST and PATCH
PATCH would look something like this:
curl -X PATCH -d '{
"temp/PUSH-ID": {
"value": 30,
"timestamp": {".sv": "timestamp"}
},
"weight/PUSH-ID": {
"value": 123,
"timestamp": {".sv": "timestamp"}
}
}' 'https://PROJECT.firebaseio.com/.json'
To create the data I want, I would currently use two POST requests in this style:
curl -X POST -d '{"value": 30, "timestamp": {".sv": "timestamp"}}' 'https://PROJECT.firebaseio.com/temp.json'
Reason
The reason why I would like to have this in one request is to save bandwidth, as the header of the request is currently a substantial part of the whole data used, and not having to transmit that so often would be the goal.