I was wondering if its possible to use a firebase cloud function to send a post request to a non-google server (from what I can find I need to be on the blaze plan in order
For those of you who want to post with a JSON body this is how you can do it. (I know I needed this a while ago)
export function postWithBodyToExternalUrl(url: string, bdy: any): Promise {
const request = require('request');
const options = {
url: url,
json: true
};
return new Promise(function (resolve, reject) {
request(options, function (err, resp) {
if (err) {
console.log(err);
reject({ err: err });
}
resolve(bdy);
});
});
}