Skip to content Skip to sidebar Skip to footer

Image Upload Using Retrofit

I am uploading image/file using retrofit here I am posting My API call to upload image baseurl/index.php?request={'img_req':{'key':'gflkgjdfkgjdkl','c':'property','a':'pr_image_upl

Solution 1:

I have found solution of above mentioned problem

Create a JSON string which contains query string parameters, and then pass Query string to API interface

@Multipart@POST("index.php")
Call<ResponseBody> uploadImage(@Query("request") String request, @Part MultipartBody.Part fileBody);

More suggestions are welcomed

Post a Comment for "Image Upload Using Retrofit"