diff --git a/dist/http.js b/dist/http.js index a2e52b1e..9afed48f 100644 --- a/dist/http.js +++ b/dist/http.js @@ -37,6 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.http = void 0; +var axios = require('axios').default; var Http = (function () { function Http() { } @@ -45,21 +46,22 @@ var Http = (function () { var _this = this; return __generator(this, function (_a) { return [2, new Promise(function (resolve, reject) { - fetch(url, _this.getOptions('post', headers, body)) + axios({ + method: 'post', + url: url, + headers: _this.getHeaders(headers), + data: JSON.parse(body) + }) .then(function (res) { return resolve(res.body); }) .catch(function (res) { return reject(res.body); }); })]; }); }); }; - Http.prototype.getOptions = function (method, headers, body) { - var options = { - headers: JSON.parse(headers), - method: method - }; - options.body = JSON.stringify(body); - options.headers['content-type'] = 'application/json'; - return options; + Http.prototype.getHeaders = function (headersString) { + var headers = JSON.parse(headersString); + headers['content-type'] = 'application/json'; + return headers; }; return Http; }()); diff --git a/dist/http.js.map b/dist/http.js.map index 3f02bbe1..5b6eb48a 100644 --- a/dist/http.js.map +++ b/dist/http.js.map @@ -1 +1 @@ -{"version":3,"file":"http.js","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;IAAA;IAuBA,CAAC;IAtBO,mBAAI,GAAV,UAAW,GAAW,EAAE,OAAe,EAAE,IAAY;;;;gBACnD,WAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;wBACjC,KAAK,CAAC,GAAG,EAAE,KAAI,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;6BAC/C,IAAI,CAAC,UAAC,GAAG,IAAK,OAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAjB,CAAiB,CAAC;6BAChC,KAAK,CAAC,UAAC,GAAG,IAAK,OAAA,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAhB,CAAgB,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AAW,aAAqB;QAC9B,IAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;QAG1C,OAAO,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAC;QAE7C,OAAO,OAAO,CAAC;IACjB,CAAC;IACH,WAAC;AAAD,CAAC,AAtBD,IAsBC;AAEY,QAAA,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC"} \ No newline at end of file diff --git a/node_modules/@vercel/ncc/dist/ncc/cli.js.cache b/node_modules/@vercel/ncc/dist/ncc/cli.js.cache index ddc3135d..ed6da5a4 100644 Binary files a/node_modules/@vercel/ncc/dist/ncc/cli.js.cache and b/node_modules/@vercel/ncc/dist/ncc/cli.js.cache differ diff --git a/node_modules/@vercel/ncc/dist/ncc/index.js.cache b/node_modules/@vercel/ncc/dist/ncc/index.js.cache index 10260cef..c2bf2dd9 100644 Binary files a/node_modules/@vercel/ncc/dist/ncc/index.js.cache and b/node_modules/@vercel/ncc/dist/ncc/index.js.cache differ diff --git a/node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache b/node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache index 390ee1f0..5832cf95 100644 Binary files a/node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache and b/node_modules/@vercel/ncc/dist/ncc/loaders/relocate-loader.js.cache differ diff --git a/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache b/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache index 31d05a08..332fc252 100644 Binary files a/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache and b/node_modules/@vercel/ncc/dist/ncc/loaders/shebang-loader.js.cache differ