multipart/form-data is currently not supported as a response type, and operations that have this response type will instead default to blob. This can be converted to formData without data loss, but it's ugly:
const res = await handle(getPet(petID), {
200: (pet) => pet
});
const contentType = res.headers.get('Content-Type') as string;
const r = new Response(res.data as unknown as FormData, {
headers: { 'Content-Type': contentType }
});
const formData = await r.formData();
const d = Object.fromEntries(formData.entries()) as unknown as Pet;
multipart/form-data
is currently not supported as a response type, and operations that have this response type will instead default toblob
. This can be converted to formData without data loss, but it's ugly:The Responses API supports directly parsing the body as FormData, so there's really no reason to not support it.