Lines 68-73
class HttpClient {
Link Here
|
68 |
const is_json = response.headers |
68 |
const is_json = response.headers |
69 |
.get("content-type") |
69 |
.get("content-type") |
70 |
?.includes("application/json"); |
70 |
?.includes("application/json"); |
|
|
71 |
|
72 |
if (return_response || !is_json) { |
73 |
return response; |
74 |
} |
75 |
|
71 |
if (!response.ok) { |
76 |
if (!response.ok) { |
72 |
return response.text().then(text => { |
77 |
return response.text().then(text => { |
73 |
let message; |
78 |
let message; |
Lines 83-91
class HttpClient {
Link Here
|
83 |
throw new Error(message); |
88 |
throw new Error(message); |
84 |
}); |
89 |
}); |
85 |
} |
90 |
} |
86 |
if (return_response || !is_json) { |
|
|
87 |
return response; |
88 |
} |
89 |
return response.json(); |
91 |
return response.json(); |
90 |
}) |
92 |
}) |
91 |
.then(result => { |
93 |
.then(result => { |
92 |
- |
|
|