Closed
Description
Hey Fosco!
In one of my objects, I had a afterSave
hook where I do a http post to another Parse app.
However, the body
parameter passed is an object, not a string, and this causes the app to throw an exception:
_http_outgoing.js:430
throw new TypeError('first argument must be a string or Buffer');
^
I looked into it, and locally was able to solve it in a easy way. When defining Parse.Cloud.httpRequest
in index.js
, line 145 I added:
if (typeof options.body === 'object') {
options.body = JSON.stringify(options.body);
}
It simply converts the object to a string if it's necessary. Is this a correct fix? If so, I can open a PR.
Metadata
Metadata
Assignees
Labels
No labels