2

I am trying to update my profile information. I am using retrofit2. When I didn't add photo in our object then I am able to update data on server using retrofit. for example

@POST("users/{id}/") 
Call<ServiceResponse> calledEditProfile(@Header("Authorization") String token,
                                                @Path("id") String id,
                                                @Part JsonObject jsonObject);

I am using this type object for updating the data.

{
  "user": {
            "fullname": "Ashutosh",
            "username": "ashu",
            "email": "ashu@gmail.com",
            "photo: ""
        }
}

and it is working fine but when I tried to upload image using multipart then it is not supporting. I have Googled many thing but didn't get satisfactory answer.

I have tried @part but didn't get success.

Please suggest me how can I move forward from here.

Thanks in advance

Bibek Shakya
  • 1,233
  • 2
  • 23
  • 45
Ash
  • 682
  • 2
  • 10
  • 20
  • 1
    well read this maybe this will help http://stackoverflow.com/questions/34562950/post-multipart-form-data-using-retrofit-2-0-including-image – Bibek Shakya Aug 28 '16 at 12:31

0 Answers0