@portkey/request
Advanced tools
Comparing version 0.0.1-alpha.1.5 to 0.0.1-alpha.1.6
@@ -31,7 +31,8 @@ "use strict"; | ||
}; | ||
const defaultHeaders = { | ||
Accept: 'text/plain;v=1.0', | ||
'Content-Type': 'application/json', | ||
}; | ||
const fetchFormat = (config, signal) => __awaiter(void 0, void 0, void 0, function* () { | ||
let { url: uri, method = 'GET', headers = { | ||
Accept: 'text/plain;v=1.0', | ||
'Content-Type': 'application/json', | ||
}, query, body, params, } = config; | ||
let { url: uri, method = 'GET', headers, query, body, params } = config; | ||
if (!uri) | ||
@@ -49,5 +50,6 @@ throw new Error('no url'); | ||
} | ||
const myHeaders = Object.assign(Object.assign({}, defaultHeaders), headers); | ||
const result = yield fetch(uri, { | ||
method, | ||
headers, | ||
headers: myHeaders, | ||
body, | ||
@@ -54,0 +56,0 @@ signal, |
{ | ||
"name": "@portkey/request", | ||
"version": "0.0.1-alpha.1.5", | ||
"version": "0.0.1-alpha.1.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "author": "", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
13994
147