title: Formatting a RetroFit post request for rails API
body: <p>All,</p>
  
  <p>I'm starting to user <code>RetroFit</code> for the first time, and it's pretty awesome. That said, I'm running into a road block when formatting a POST request.</p>
  
  <p>The API I'm using specifies that to create a user, I need to send the user object like this:</p>
  
  <pre><code>{
  "user": {
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@doe.com",
      "password": "jigglypuff123",
      "password_confirmation": "jigglypuff123"
    }
  }
  </code></pre>
  
  <p>I know that I can send a <code>JsonObject</code> in this form, but I'd instead like to leverage <code>RetroFit</code>.</p>
  
  <p>If I pass in a <code>User</code> object, it doesn't get wrapped in <code>user</code>. Just</p>
  
  <pre><code>{
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@doe.com",
      "password": "jigglypuff123",
      "password_confirmation": "jigglypuff123"
    }
  </code></pre>
  
  <p>is sent. </p>
  
  <p>I tried using the <code>@Field</code> annotation, and ended up with this:</p>
  
  <pre><code>@POST("/users")
      void createUser(@Field("user[first_name]") String first, @Field("user[last_name]") String last, @Field("user[email]") String email, @Field("user[password]") String password, @Field("user[password_confirmation]") String password_confirmation, Callback&lt;User&gt; cb);
  </code></pre>
  
  <p>I ended up with this error:</p>
  
  <pre><code>@Field parameters can only be used with form encoding. (parameter #1)
  </code></pre>
  
  <p>Does anyone know how to achieve this?</p>