title: How to pass Map<String, String> parameters or object to POST request via Retrofit?
body: <p>I have a problem with passing Map parameters or object to Retrofit POST request.</p>
  
  <p>I follow <a href="http://square.github.io/retrofit/" rel="nofollow noreferrer">square</a>, <a href="http://kdubblabs.com/java/retrofit-by-square/" rel="nofollow noreferrer">kdubb labs</a> tutorials and <a href="https://stackoverflow.com/questions/17580062/how-can-i-configure-squares-retrofit-client-to-handle-a-request-with-a-variable?rq=1">this thread</a> and I couldn't figure it out.</p>
  
  <p>My current code which works:</p>
  
  <pre><code>public interface FacebookUser {
      @FormUrlEncoded
      @POST("/user/login-facebook")
      void login(
              @Field("fb_access_token") String fbAccessToken,
              @Field("os") String os,
              @Field("device") String device,
              @Field("os_version") String osVersion,
              @Field("app_version") String appVersion,
              @Field("online") String online,
              Callback&lt;FacebookLoginUserResponse&gt; callback
      );
  }
  </code></pre>
  
  <p>and code:</p>
  
  <pre><code>RestAdapter restAdapter = new RestAdapter.Builder()
                          .setServer(requestMaker.getUrl())
                          .build();
  
  FacebookUser facebookUser = restAdapter.create(FacebookUser.class);
  facebookUser.login(getFbAccessToken(),
  getString(R.string.config_os),
  Info.getAndroidId(getBaseContext()),
  Build.VERSION.RELEASE,
          Info.getAppVersionName(getBaseContext()),
          "" + 1,
          new Callback&lt;FacebookLoginUserResponse&gt;() {
      @Override
      public void success(FacebookLoginUserResponse facebookLoginUserResponse, Response response) {
      }
  
      @Override
      public void failure(RetrofitError retrofitError) {
      }
  });
  </code></pre>
  
  <p>When I try to use this interface I receive from server that parameters are missing:</p>
  
  <pre><code>public interface FacebookUser {
      @POST("/user/login-facebook")
      void login(
              @Body Map&lt;String, String&gt; map,
              Callback&lt;FacebookLoginUserResponse&gt; callback
      );
  }
  </code></pre>
  
  <p>and map:</p>
  
  <pre><code>HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();
      map.put("fb_access_token", getFbAccessToken());
      map.put("os", "android");
      map.put("device", Info.getAndroidId(getBaseContext()));
      map.put("os_version", Build.VERSION.RELEASE);
      map.put("app_version", Info.getAppVersionName(getBaseContext()));
      map.put("online", "" + 1);
  </code></pre>
  
  <p><strong>Questions:</strong>
  What is it wrong?
  How can I pass object to request? </p>