diff --git a/makeHttpCall.js b/makeHttpCall.js index 04f34315..c4311ff3 100644 --- a/makeHttpCall.js +++ b/makeHttpCall.js @@ -12,14 +12,13 @@ const axios = require('axios'); * @throws {Error} If an error occurs during the request. */ -async function makeHttpCall(method, url, data = null, headers = {}) { +async function makeHttpCall(method, url, data = undefined, headers = {}) { try { - const response = await axios({ - method, - url, - data, - headers, - }); + const options = { + url, method, headers, data + } + + const response = await axios(options); return response; } catch (error) { @@ -27,7 +26,6 @@ async function makeHttpCall(method, url, data = null, headers = {}) { } } - module.exports = { makeHttpCall -} \ No newline at end of file +}