We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4c7c126 + e13d7c2 commit cc623f6Copy full SHA for cc623f6
core/src/core-plugins.ts
@@ -419,14 +419,20 @@ export class CapacitorHttpPluginWeb extends WebPlugin implements CapacitorHttpPl
419
420
let data: any;
421
let blob: any;
422
+ let responseText: string;
423
switch (responseType) {
424
case 'arraybuffer':
425
case 'blob':
426
blob = await response.blob();
427
data = await readBlobAsBase64(blob);
428
break;
429
case 'json':
- data = await response.json();
430
+ responseText = await response.text();
431
+ try {
432
+ data = JSON.parse(responseText);
433
+ } catch (e) {
434
+ data = responseText;
435
+ }
436
437
case 'document':
438
case 'text':
0 commit comments