:wave: Starting to play around with Compose Web a...
# compose-web
👋 Starting to play around with Compose Web and just wondering if there are any good examples of submitting multipart form data to a ktor backend? I’m able to upload files to my ktor endpoint fine via
, but when I try submitting the form from compose, the multipart data never shows up. Coming from an Android background so my web skills are pretty rusty these days--definitely could just be missing something obvious
Why don't you just send a regular HTTP post request with json payload instead? Forms are ancient.
fair enough--forms used to be cool when I did web 😅, so it’s been quite a while
I don’t suppose you have any examples of that approach with Compose web?
You van either use fetch api or ktor client
The rest is really well documented on the web
thanks for the info--i’m not familiar with fetch, so I was leaning towards using the ktor client. Think I need to just start from square 1 again. I’m mostly just looking into this out of curiosity
For what it's worth, I don't think there's anything wrong with forms per se. Yeah, they've been around for a while, but they still do their original job just fine. What is true is that for the kinds of applications that compose is designed for, sticking to HTML forms for everything is usually not possible, so it's worth investing the time to learn the modern APIs.