Using Retrofit 2.0.1, there is a call function in my API interface defined in Android App:
@Multipart
@POST(\"api.php\")
Call doAPI(
@Part(
I faced this on my project today and this is how I solved it. I changed @Part on my string and other primitive values to @Query, and for file (in my case image) i used @Part. Looks like @Query treats strings in a different way compared to @Part.
So my answer to original question would look like this:
@Multipart
@POST("api.php")
Call doAPI(
@Query("lang") String lang,
@Part("file\"; filename=\"image.jpg") RequestBody file
);
This should send string values without unwanted quotes. Sadly, I cant explain why this works, it has something to do with @Part encoding of data.