how to use retrofit 2 to send file and other params together
I am looking for an example how could I send file and other params together to server. I have to send server JSON which { "title": "title", "file": "uploaded file instance", "location": { "lat": 48.8583, "lng": 2.29232, "place": "Eiffel Tower" } } How could I create Retrofit to handle this case? If file is a string I know how to handle this. If file is File object I have no idea how to do this. Use gson and create a model class for the location. Add the following dependencies to your build.gradle . compile 'com.squareup.retrofit2:converter-gson:2.0.0' compile 'com.google.code.gson:gson:2.5'