Image input

This commit is contained in:
Ian Gulliver
2026-10-14 20:07:26 -07:00
parent bd8702ee87
commit 9e741ede32
27 changed files with 1044 additions and 122 deletions
+5 -1
View File
@@ -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);
}