diff --git a/src/request.js b/src/request.js index 9b0a622..8a92923 100644 --- a/src/request.js +++ b/src/request.js @@ -30,7 +30,7 @@ export default function request(url, config = {}) { } return baseRequest(apiUrl, requestConfig) - .then(res => res.json()) + .then(res => (onlyJsonResponse ? res.json() : { json: res.json(), url: res.url })) .catch(err => { console.error(err) throw err