I need to send a POST request to a server. I'm supposed to pass some parameters and an image. I am able to do this from Postman, but I can't do this on my Android app (latest SDK) using Fuel.
This is the code I'm using:
val formData = listOf("name" to "name")
val (_, _, result) = Fuel.upload("http://10.0.2.2:3000/test", parameters = formData)
.source { request, url -> imageFile } // type is File
.responseObject<CustomResponse>()
This is the postman screenshot:

I don't have access to the backend code, just some logs. It seems the request body is empty and the file also doesn't get uploaded. How can I do this? I'm at a loss.
I also tried passing the parameters as a jsonBody, this does submit the body, but the content type is not multipart/form-data and the image is still missing.
This JS code works:
let formData = new FormData();
formData.append('name', 'name');
formData.append('image', this.file);
axios.post(`${API_URL}/test`, formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
}).then(console.log).catch(console.log)
Edit: I also tried passing the file as a DataPart, still nothing.