Closed muhammadelkady25 closed 4 years ago
Hi @muhammadelkady25 I suspect the error is not in the library. I see 10 headers from the Postman screenshot which are not provided in the upload code. To debug the payloads which are sent, setup OkHttp Stack together with Stetho or Gander inspectors.
Why using a suspend fun
? MultipartUploadRequest
is not blocking in any way. It's simply a safe builder for upload service intents.
Thank you for your help @gotev I used Logging Interceptor. An OkHttp interceptor which logs HTTP request and response data. and here are my logs
D/OkHttp: --> POST https://qadi-quran.herokuapp.com/upload/media
D/OkHttp: Content-Length: 630897
D/OkHttp: Content-Type: multipart/form-data; boundary=-------UploadService4.0.0-rc2-21361348441798
D/OkHttp: Connection: close
D/OkHttp: ---------UploadService4.0.0-rc2-21361348441798
D/OkHttp: Content-Disposition: form-data; name="parent_id"
D/OkHttp: main-media
D/OkHttp: ---------UploadService4.0.0-rc2-21361348441798
D/OkHttp: Content-Disposition: form-data; name="title"
D/OkHttp: 2KrYrNix2YrYqNmKINmm
D/OkHttp: ---------UploadService4.0.0-rc2-21361348441798
D/OkHttp: Content-Disposition: form-data; name="media"; filename="-17.mp3"
D/OkHttp: Content-Type: audio/mpeg
D/OkHttp: ... long content ...
D/OkHttp: ---------UploadService4.0.0-rc2-21361348441798--
D/OkHttp: --> END POST (630897-byte body)
You're welcome 😃
Parameters set are correctly sent. Can't see evidence of Android Upload Service malfunction here.
Also, avoid uri.path!!
in favor of uri.toString()
😃 !!
is an unrecoverable crash point in Kotlin 💥
Thank you very much for your help. As it seems not an issue with Android Upload Service, I will close this issue.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related issues, referencing this one.
I have a server with an endpoint that takes a file and two parameters. It is working on postman as expected
But it is not working with the library.
The server returns Incomplete Post Data. which means one or more param is missing And here is the logs