refactor: webapi http
This commit is contained in:
1 parent
1e4ab961b2
commit
43b4c6d48f
2 files changed
+7
-2
No files matched your search
@@ -61,7 +61,12 @@ export class RequestUtil {
|
||||
requestInit.headers = new Headers(headers);
|
||||
}
|
||||
try {
|
||||
const response = await fetch(url, { ...requestInit, body: data });
|
||||
let response;
|
||||
if (method.toUpperCase() === 'POST') {
|
||||
response = await fetch(url, { ...requestInit, body: data });
|
||||
} else {
|
||||
response = await fetch(url, { ...requestInit });
|
||||
}
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
|
||||
+1
-1
Submodule src/core updated: d06dd4d66c...f88118be51.
Reference in new issue
Block a user