title: POSTing an audio file with Retrofit
body: <p>The problem is this. I am sending a music file. I keep getting error <code>422</code>. For this reason, it seems I am not able to properly position my body</p>
  <p><a href="https://i.stack.imgur.com/yZoRm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yZoRm.png" alt="enter image description here" /></a>
  this is my output from the console</p>
  <pre><code>Content-Disposition: form-data; name=&quot;Content-Disposition: form-data; 
  name=&quot;audio[file]&quot;; filename=&quot;tr.mp3&quot;&quot;
  Content-Transfer-Encoding: binary
  Content-Type: audio/mpeg
  Content-Length: 6028060
  </code></pre>
  <p>and my code</p>
  <pre><code>@Multipart
  @Headers({&quot;Content-Type: multipart/form-data;&quot;, &quot;Accept:application/json, text/plain, */*&quot;})
  @POST(&quot;audios&quot;)
  Call&lt;SoundResponse&gt; saveSound(@Part (&quot;Content-Disposition: form-data; name=\&quot;audio[file]\&quot;; filename=\&quot;tr.mp3\&quot;&quot;) RequestBody file,
                                @Query(&quot;auth_token&quot;) String authToken);
  </code></pre>
  <p>and called this method</p>
  <pre><code>        RequestBody body = RequestBody.create(MediaType.parse(&quot;audio/mpeg&quot;), file);
  
          GeoService.saveSound(body,SoundResponseCallback, getAuthToken());
  </code></pre>
  <p>I also found this stuff<br />
  <a href="https://stackoverflow.com/questions/39078192/send-file-to-server-via-retrofit2-as-object">Send file to server via retrofit2 as object</a></p>
  <p><strong>It seems to me that the problem is that the field looks like this &quot;audio</strong> [file]&quot;</p>
  <p>Thank you for your help</p>