Retrofit post using Firebase
<p>Please any one please help. This is My API method</p>

<pre><code>@POST("/user/new.json")
Call createUser(@Body User user);
</code></pre>

<p>This is my call in <code>MainActivity</code></p>

<pre><code> Retrofit retrofit=new Retrofit.Builder().baseUrl("https://XXXXXX.firebaseio.com").addConverterFactory(GsonConverterFactory.create()).build();

    Api api=retrofit.create(Api.class);

    User user=new User(1,"Sam");

    Call&lt;User&gt; call=api.createUser(user);
    call.enqueue(new Callback&lt;User&gt;() {
        @Override
        public void onResponse(Call&lt;User&gt; call, Response&lt;User&gt; response) {
            Log.d("sam","run");
        }

        @Override
        public void onFailure(Call&lt;User&gt; call, Throwable t) {
            Log.d("sam","error");
        }
    });
</code></pre>

<p>This is <code>User.java</code></p>

<pre><code>public class User {

        int id;

        String name;

        public User(int id, String name) {
            this.id = id;
            this.name = name;
        }
    }
</code></pre>

<p>Output is coming like that :-</p>

<pre><code>"user" : {"new" : {"-KBgcQTomo8xGpnv5raM" : {"id" : 1,"name" : "Sam"}}}
</code></pre>

<p>But i want output like that :- </p>

<pre><code>"user" : {"new" : {"id" : 1,"name" : "Sam"}}
</code></pre>

<p>Here is Tutorial For <a href="http://sushildlh-retro-firebase.blogspot.in/" rel="nofollow">Retrofit + Firebase</a></p>

<p>please help................</p>