Philipp
Philipp
Explore posts from servers
CDCloudflare Developers
Created by Philipp on 2/22/2025 in #pages-help
No route for that URI when try to enable Access policy
No description
4 replies
HHono
Created by Philipp on 12/1/2024 in #help
How to respond with multipart/form-data, containing image and json?
Hi, i'm trying to respond with multipart/form-data format but cant find any working example of how i should do this. https://hono.dev/docs/api/context#body How can i make working response with, for example, one png file const imageBuffer = await imageFile.arrayBuffer(); and some other field i.e. "{"json":"somejson"}"? I've tried some approaches but they didn't work and insomnia returned errors in attempts to read response.
return c.body(bodycontent? || null, 200, { // What format should i use for bodycontent?
"Content-Type": "multipart/form-data"; "boundary":${boundary},
// Anything need to be added here?
});
return c.body(bodycontent? || null, 200, { // What format should i use for bodycontent?
"Content-Type": "multipart/form-data"; "boundary":${boundary},
// Anything need to be added here?
});
6 replies