Hi everyone, I am using Ktor 1.5.0 to upload an im...
# ktor
j
Hi everyone, I am using Ktor 1.5.0 to upload an image to server in a KMM project, I am passing the image as a byteArray but I am getting a bad request response, here is the code:
Copy code
client.submitFormWithBinaryData<FaceResponse> {
    method = <http://HttpMethod.Post|HttpMethod.Post>
    url(IMAGE_URL)
    headers {
        this["x-api-key"] = "my_api_key_here"
    }
    parameter(
        "mode", "request_mode"
    )
    body = MultiPartFormDataContent(formData {
        append("image", request.image)
    })
}
Does anyone know what is the issue? Thanks
e
Hey @Jawid, could you post the exception with stacktrace? You also can install
Logging
feature to get some information about problems you have.