Update: okay partially worked, had to do it like t...
# ktor
r
Update: okay partially worked, had to do it like this
Copy code
request.items.forEachIndexed { index, item ->
    append("items[$index][name]", item.name)
    append("items[$index][qty]", item.qty)
    append("items[$index][price]", item.price)
    item.categoryId?.let { append("items[$index][category_id]", item.categoryId) }
}
and it did send it as a list of objects 🎉 but now I noticed that everything is converted into a string, even numbers, how can I avoid this?
c
From memory, the multipart/form-data specification only supports strings (or files) so that is working as intended
r
Which is weird, I've seen the internal code and it does convert everything to string, but how does it work when I send a normal serializable data class, but when I do it manually in a form-data it doesn't work? basically what I want to do is send a normal body but the exception is that I want to also send an image with it. maybe I'm looking at the wrong solution here?