From 2fba043575e6a8db94434986c1781d2716c8f6d4 Mon Sep 17 00:00:00 2001 From: Bastien Wirtz Date: Sun, 10 Oct 2021 10:37:20 +0200 Subject: Allow non json reponse in fetch. --- src/mixins/service.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mixins/service.js') diff --git a/src/mixins/service.js b/src/mixins/service.js index ae23a27..17fa6fc 100644 --- a/src/mixins/service.js +++ b/src/mixins/service.js @@ -12,7 +12,7 @@ export default { } }, methods: { - fetch: function (path, init) { + fetch: function (path, init, json = true) { let options = {}; if (this.proxy?.useCredentials) { @@ -35,7 +35,8 @@ export default { if (!response.ok) { throw new Error("Not 2xx response"); } - return response.json(); + + return json ? response.json() : response; }); }, }, -- cgit v1.2.3