Send json and file with Retrofit2
<p>I used to send POST request to server with <strong>Retrofit2</strong>:</p>

<pre><code>    @POST("goals")
    Call&lt;Void&gt; postGoal(@Body Goal goal);
</code></pre>

<p>where Goal was object with some String/Integer fields.</p>

<p>Now I need to add a photo file there.
I know I need to <strong>switch</strong> to use <strong>Multipart</strong>:</p>

<pre><code>    @Multipart
    @POST("goals")
    Call&lt;Void&gt; postGoal(
            @Part("picture") RequestBody picture
            );

//...
//Instantaining picture 
RequestBody.create(MediaType.parse("image/*"), path)
</code></pre>

<p>But how am I supposed to add previous fields ? In particular is there a way to add whole Goal object without dividing it for fields ? </p>