Include Curly brackets into String CURL

I'm trying to build a curl command with the following structure:

Console.println("Call Linux Command to Send Data");

Process proc;

proc.runShellCommand("curl -k -g preapiv2.wattabit.com/wdevices/v1/publish/generic?token=XXXXXXX&type=MATRIX&dataloggerId=XXXXXXX&timezone=Romance%20standard%20Time&data=[{'dev':'2'}]");

while (proc.available()>0) { char c = proc.read(); Console.write((char)c);

}

It seems that the curly brackets [{}] are not processed correctly in the string.

Any idea?

IS this an Arduino programming question ?

If so then please post a complete program rather than snippets.

The only problem I have is on the method were I upload the data:

void uploadData() {//Upload Data

Console.println("Call Linux Command to Send Data Wattabit"); Process proc; // Create a proce ss and call it "proc", this process will execute a Linux curl command

proc.runShellCommand("curl -k -g preapiv2.wattabit.com/wdevices/v1/publish/generic?token=XXXXXX&type=MATRIX&dataloggerId=XXXXXX&timezone=Romance%20standard%20Time&data=[{'dev':'2'}]");

delayMicroseconds(40);

Console.print("Feedback from Linux: "); // If there's output from Linux, // send it out the Console: while (proc.available()>0) { char c = proc.read(); Console.write((char)c);

}

Console.println(""); Console.println("Call Finished"); Console.println("####################################"); Console.println(""); }

It should work fine in c or c++. Whether the ide handles it correctly during display or preprocessing is a separate question. Can you be more specific about “not processed correctly”?

My problem falls on the use of curly brackets on the URL. This URL is intended to post information to a given data base and in case of success it returns TRUE. The point is that every time I use these brackets to form a jason array the curl command is not generated correctly due to no response of the server is done.

I have also tried to send the hexa value of the brackets (%5B%7B%7D%5D ) but either not work.

If someone could provide and example curl command with curly brackets inside the URL and the proper atributtes used ( -g for example) it would be usefull for me.

Thanks

proc.runShellCommand("curl -k -g preapiv2.wattabit.com/wdevices/v1/publish/generic?token=XXXXXX&type=MATRIX&dataloggerId=XXXXXX&timezone=Romance%20standard%20Time&data=[{'dev':'2'}]");

I think your curly brackets (and perhaps other characters) are disappearing as a result of whatever shell is being used by "runShellCommand", rather than anything on the Arduino side. properly quoting magic shell characters that need to make it to a program's actual argument is an art unto itself :-( try an extra set of quotes:

proc.runShellCommand("curl -k -g \"preapiv2.wattabit.com/wdevices/v1/publish/generic?token=XXXXXX&type=MATRIX&dataloggerId=XXXXXX&timezone=Romance%20standard%20Time&data=[{'dev':'2'}]\"");