title: Android Retrofit POST request doesn't work but in Postman it works
body: <p>I find same problem this
  <a href="https://stackoverflow.com/questions/42550437/android-retrofit-post-request-doesnt-work-but-in-postman-it-works#">Android Retrofit - POST request doesn&#39;t work, but in Postman it works</a></p>
  
  <p>But I could not solve it</p>
  
  <p>this is gradle</p>
  
  <pre><code>compile 'com.squareup.retrofit2:retrofit:2.3.0'
  compile 'com.squareup.retrofit2:converter-gson:2.3.0'
  compile 'com.squareup.okhttp3:okhttp:3.8.0'
  compile 'com.google.code.gson:gson:2.8.0'
  </code></pre>
  
  <p>this is my code to post request in android</p>
  
  <pre><code>static final String URL = "http://localhost:3000/";
  
       public void map(){
      Retrofit retrofit = new Retrofit.Builder()
              .baseUrl(URL)
              .addConverterFactory(GsonConverterFactory.create())
              .build();
      Map map = new HashMap();
      map.put("gender", UserSex);
      map.put("age", UserAge);
      map.put("name", UserName);
      map.put("password", UserPw);
      map.put("email", UserEmail);
  
      GitHubService gitHubService = retrofit.create(GitHubService.class);
      Call&lt;RetrofitRepo&gt; call = gitHubService.getUserItem(map);
      call.enqueue(new Callback&lt;RetrofitRepo&gt;() {
          @Override
          public void onResponse(Call&lt;RetrofitRepo&gt; call, Response&lt;RetrofitRepo&gt; response) {
              try {
                  RetrofitRepo repoList = response.body();
                  String message = repoList.getmessage();
                  String token = repoList.gettoken();
  
                  if (message.equals("registered successfully")) {
                      Intent intent = new Intent(UserEnroll.this, LoginActivity.class);
                      startActivity(intent);
                      Toast.makeText(context, "register success.", Toast.LENGTH_SHORT).show();
                  } else {
                      Toast.makeText(context, "register failed.", Toast.LENGTH_SHORT).show();
                  }
              }catch (Exception e){
                  e.printStackTrace();
              }
          }
  
          @Override
          public void onFailure(Call&lt;RetrofitRepo&gt; call, Throwable t) {
  
          }
      });
  }
  </code></pre>
  
  <p>and this is interface</p>
  
  <pre><code>public interface GitHubService {
  
  @FormUrlEncoded
  @POST("api/auth/login")
  Call&lt;RetrofitRepo&gt; getPost(
          @Field("username") String username
  );
  
  @FormUrlEncoded
  @POST("api/auth/placeSearch")
  Call&lt;RetrofitRepo&gt; getPlaceID(
          @Field("placeID") String placeID
  );
  
  @FormUrlEncoded
  @POST("api/auth/login")
  Call&lt;RetrofitRepo&gt; getItem(
          @FieldMap Map&lt;String, String&gt; option
  );
  
  @FormUrlEncoded
  @POST("api/auth/register")
  Call&lt;RetrofitRepo&gt; getUserItem(
          @FieldMap Map&lt;String, String&gt; option
  );
  </code></pre>
  
  <p>}</p>
  
  <p>i use node js this is response code</p>
  
  <pre><code>exports.register = (req, res) =&gt; {
  const { email, password, name, age, gender } = req.body
  let newUser = null
  
  const create = (user) =&gt; {
      if(user) {
          throw new Error('email exists')
      } else {
          return User.create(email, password, name, age, gender)
      }
  }
  
  const count = (user) =&gt; {
      newUser = user
      return User.count({}).exec()
  }
  
  const assign = (count) =&gt; {
      if(count === 1) {
          return newUser.assignAdmin()
      } else {
          return Promise.resolve(false)
      }
  }
  
  const respond = (isAdmin) =&gt; {
      res.json({
          message: 'registered successfully',
          admin: isAdmin ? true : false
      })
  }
  
  const onError = (error) =&gt; {
      res.status(409).json({
          message: error.message
      })
  }
  
  User.findOneByEmail(email)
  .then(create)
  .then(count)
  .then(assign)
  .then(respond)
  .catch(onError)}
  </code></pre>
  
  <p>I requested using a postman and it worked </p>
  
  <pre><code>http://localhost:3000/api/auth/register
  {
  "email": "test6@google.com",
  "password": "abc123@",
  "name": "user",
  "age": "18",
  "gender": "F"}
  </code></pre>
  
  <p>POST /api/auth/register 409 13.393 ms - 26 or 
  POST /api/auth/register 200 15.064 ms - 51 it responded in node</p>
  
  <p>but its not work on my android app using retrofit
  and not responded in node</p>