I have created rest service using .js file on Parse.com. I want to access cloud function from arduino.
i tried this
client.get(https://myAppID:[email protected]/1/functions/hello");
i am getting error "Method not allowed".
Solution : Somehow i got the answer which is as follows.I hope it will help others.
ParseCloudFunction cloudFunction;
cloudFunction.setFunctionName(function_name); //string ("hello")
cloudFunction.add("light_sensor", light); //pass parameter to cloud
ParseResponse response = cloudFunction.send();
Serial.println(response.getJSONBody());
Abhijeet KulkarniAbhijeet Kulkarni
asked Oct 27, 2015 at 13:10
-
What is a rest service?Nick Gammon– Nick Gammon ♦2015年10月29日 07:01:34 +00:00Commented Oct 29, 2015 at 7:01
-
REST api i have written on Parse side that i want to access from Arduino sketch.Abhijeet Kulkarni– Abhijeet Kulkarni2015年11月02日 10:57:07 +00:00Commented Nov 2, 2015 at 10:57
1 Answer 1
I read api of Parse and there i got the class to call cloud function from Arduino.I hope it will help others.
ParseCloudFunction cloudFunction;
cloudFunction.setFunctionName(fnname); //String ("hello")
cloudFunction.add("light_sensor", 139); //parameter
ParseResponse response = cloudFunction.send();
Serial.println(response.getJSONBody());
answered Nov 23, 2015 at 13:06