https://kotlinlang.org logo
Title
r

Rajput Art Studio

08/14/2022, 5:29 AM
Hi Team Facing one issue in Android ktor client. When sending multipart data with image then it throws error Multipart class not a serialised class. How to implement a ktor inbuild class with serialised annotation. Thanks in advance
p

Pamela Hill

08/15/2022, 2:31 PM
Can you post some sample code of what you're trying to do?
Did you look at this example: https://ktor.io/docs/request.html#upload_file
a

Aleksei Tirman [JB]

08/16/2022, 10:04 AM
Probably, the problem is that you send a request with the
Content-Type: application/json
header so the
ContentNegotiation
plugin tries to serialize a
MultiPartFormDataContent
object. If this is the case, just remove the
Content-Type
header from a request if it’s configured via
DefaultRequest
plugin.