Send data to Hono

Hi, how can i send Request body and file on same route.
11 Replies
Nico
Nico4mo ago
You want to show an image and body text? You can’t serve a file with body text as far as I know. It would have to be html for that
Niamarou#klm09
Niamarou#klm094mo ago
ok I want to send an image and its name to my server. How can I do this with hono? i will save the name on my db and it path to the db
Nico
Nico4mo ago
You would need to send it in a multipart form That way you can send an image plus form data
iiammehmet
iiammehmet4mo ago
exactly, I agree with you. You need to define the body request as a multipart or form to attach any file, then get form data from the request
iiammehmet
iiammehmet4mo ago
eg: postman
No description
iiammehmet
iiammehmet4mo ago
curl --location --request GET 'http://localhost:3000/iamge/' \ --form 'image=@"/C:/Users/5db80f85d8883aa1e13d1d8dfd346401.jpg"'
Nico
Nico4mo ago
Thanks for adding more to it, I’m only on my phone
iiammehmet
iiammehmet4mo ago
the topic has been resolved. @Niamarou#klm09 i helped. let others know
No description
Niamarou#klm09
Niamarou#klm094mo ago
Thanks
Niamarou#klm09
Niamarou#klm094mo ago
😂