KevinGrandon/sparky — pull request #8 by bazitov (2014-01-19 01:40:52+00:00)
Title: Run custom command fixes

— Command can now be CamelCase
— args are now sent in double quotes as shown in the documentation

Here is an example of my Spark code:
….
int setBlinkPeriod(String period);

void setup() {
Spark.function("setBlink", setBlinkPeriod);
}
….
I used camelCase to expose the setBlinkPeriod function on the API.

Here is the working curl call (taken from the documentation):
curl https://api.spark.io/v1/devices/53ff6d065067544822520487/setBlink -d access_token=7a05e47243158d2a92e78a88a77695baa334ae70 -d "args=123"

When tried to run the same API call via Sparky:
core1.run('setBlink', '123', function(res) {
console.log(res);
});
with debug option I got a slightly different curl call:
curl https://api.spark.io/v1/devices/53ff6d065067544822520487/setblink -d access_token=7a05e47243158d2a92e78a88a77695baa334ae70 -d args=123

This patch fixes the above issues.