Image input
This commit is contained in:
Vendored
+5
-1
@@ -24,7 +24,11 @@ export async function request(method, path, opts = {}) {
|
||||
url += `?${query}`;
|
||||
}
|
||||
const init = { method: method.toUpperCase() };
|
||||
if (opts.body !== undefined) {
|
||||
if (opts.body instanceof Blob) {
|
||||
init.headers = { "Content-Type": opts.body.type || "application/octet-stream" };
|
||||
init.body = opts.body;
|
||||
}
|
||||
else if (opts.body !== undefined) {
|
||||
init.headers = { "Content-Type": "application/json" };
|
||||
init.body = JSON.stringify(opts.body);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user