Send data to Firebase database by POST

I am using the Arduino YUN to send data information to Firebase via wifi. I can retrieve information from my database (Using the httpclientConsole example in arduino) but I am having a hard time sending data to it. I tried running this code as well and replacing the proper URL: https://forum.arduino.cc/index.php?topic=474536.0
Here is the code that I got from the Firebase references that I’m trying to get to work:

#include <Process.h>
#include <Bridge.h>
#include <Console.h>
void setup()
{
Bridge.begin(); // Initialize the Bridge
Console.begin(); // initialize Console communication
while(!Console);

}

void loop()
{

// Simulate Get Sensor value
int sensor = random(10, 20);

Process p;

//I put the proper project name which is the name of my database
p.runShellCommand("curl -X POST -d ‘{“user_id” : “jack”, “text” : “Ahoy!”}’ ‘https://[My project name].firebaseio.com/.json’ ");

Console.println(sensor);
while(p.running());
delay(500);

}

This is where I got the code: Firebase Database REST API

Default Yun OS is missing root certificates for firmware size constraint.

Two work arround:

  1. Use “-k” switch to make insecure connection.
curl -k -X POST -d '{"user_id"  : "jack", "text" : "Ahoy!"}'  'https://[My project name].firebaseio.com/.json'

-k, --insecure

(TLS) By default, every SSL connection curl makes is verified to be secure. This option allows curl to proceed and operate even for server connections otherwise considered insecure.

  1. Adding root certificates through opkg
    You can use opkg to install the certificates from the major CA
 opkg  update
opkg install ca-certificates

.