How can I do a request like this using the ktor cl...
# ktor
j
How can I do a request like this using the ktor client?
curl --request POST --form "field=value" <http://localhost:8080>
I have tried looking at
submitForm
but when using this it just gives this error:
Serializer for class 'FormDataContent' is not found.
p
I don't know why
submitForm
doesn't work, but you can manually wrap the body in
MultiPartFormDataContent
and it seems to work
Untitled.kt
j
Gives the same issue
Serializer for class 'MultiPartFormDataContent' is not found.
Sorry, found my mistake. I had this in my client configuration:
Copy code
header(HttpHeaders.ContentType, ContentType.Application.Json)
👍 1