php - Correct way to pass values to Cloud function -
i have tried various approaches cannot seem right.
when pass info cloud function have problem retrieving them in cloud code.
example:
parsecloud::run('addalarm', ['subject' => $subject]);
will pass next request function in cloud code:
{"body":"{\"subject\":\"re: alarm\"}","params":{"subject":"re: alarm"},"installationid":"","user":null,"master":false}
i can read request.body
get:
{"subject":"re: alarm"}
but reading request.body.subject
yields undefined
i unable find examples arguments passed cloud function in php, running on trial , error.
"body":"{\"subject\":\"re: alarm\"}"
in json key body
holds string looks json. can either utilize json.parse(request.body)
in javascript or utilize php method sends body object.
php json parse.com
No comments:
Post a Comment