I'm trying to make a POST request from Parse to Firebase, using Parse Cloud Code and Firebase's REST API.
Parse.Cloud.define("createChatRoom", function(request, response) {
Parse.Cloud.httpRequest({
url: 'https://myapp.firebaseIO.com/' + '.json',
method: 'PUT',
body: {"hi": "hello"}
}).then(function(httpResponse) {
response.success("Successfully posted hello!");
},function(httpResponse) {
response.error("failed to post hello" + httpResponse.text)
})
})
However, this code makes Firebase respond with the following error:
"Invalid data; couldn't parse JSON object, array, or value. Perhaps you're using invalid characters in your key names."
I have tried a multitude of combinations for body, including variations of apostrophes, integers, and removing brackets altogether.
Any ideas?