mirror of
https://github.com/joelwmale/webhook-action.git
synced 2026-09-03 05:06:13 +08:00
Allow optional headers & body
This commit is contained in:
Vendored
+4
-2
@@ -14,10 +14,12 @@ var Http = (function () {
|
||||
};
|
||||
Http.prototype.getOptions = function (method, headers, body) {
|
||||
var options = {
|
||||
headers: JSON.parse(headers),
|
||||
headers: headers ? JSON.parse(headers) : {},
|
||||
method: method
|
||||
};
|
||||
options.body = JSON.stringify(body);
|
||||
if (body) {
|
||||
options.body = body;
|
||||
}
|
||||
options.headers['content-type'] = 'application/json';
|
||||
return options;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user