title: Retrofit POST request to Spring Boot service
body: <p>I am using Retrofit for post request to Spring Boot service but always is called failure Callback method. This is my simplified code:</p>
  
  <p>Spring Boot service (Controller):</p>
  
  <pre><code>@RestController
  public class ServController {
  
     @Autowired
     private UserRepository userRepository;
  
     @RequestMapping(value = "/user", method = RequestMethod.POST)
     public Boolean signUpUser(@RequestBody User user)
     {
  
        return true;
     }
  }
  </code></pre>
  
  <p>My client interface:</p>
  
  <pre><code>public interface ChainApi {
  
      public static final String USER_PATH = "/user";
  
      @POST(USER_PATH)
      public void signUpUser(@Body User user, Callback&lt;Boolean&gt; callback);
  }
  </code></pre>
  
  <p>Async POST request:</p>
  
  <pre><code>User user = new User();
  user.setId(12);
  user.setName(nameEtx.getText().toString());
  user.setEmail(emailEtx.getText().toString());
  user.setPassword(passwordEtx.getText().toString());
  
  RestAdapter restAdapter = new RestAdapter.Builder()
              .setEndpoint(Constant.URL_LOCALHOST)
              .build();
  
  ChainApi service = restAdapter.create(ChainApi.class);
  
  service.signUpUser(user, new Callback&lt;Boolean&gt;() {
      @Override
      public void success(Boolean aBoolean, Response response) {
  
          Log.i(TAG, "Succesfull");
  
      @Override
      public void failure(RetrofitError error) {
  
          Log.i(TAG, "Error " + error.getMessage()); // 400 Bad Request
  
      }
  });
  </code></pre>
  
  <p>This is my User class(POJO):</p>
  
  <pre><code>@JsonIgnoreProperties(value = { "additionalProperties"})
  public class User {
  
      @JsonProperty("id")
      private Integer id;
      @JsonProperty("name")
      private String name;
      @JsonProperty("password")
      private String password;
      @JsonProperty("email")
      private String email;
      @JsonIgnore
      private Map&lt;String, Object&gt; additionalProperties = new HashMap&lt;String, Object&gt;();
  
      // methods
  }
  </code></pre>
  
  <p>NOTES: I am developing in Android and when make manual POST request from Postman I get 200 OK.
  In addition I get in logcat message: <strong>400 Bad Request</strong></p>