title: Spring Boot - Request method 'POST' not supported
body: <p>I got exception <code>PageNotFound: Request method 'POST' not supported</code> in my Spring Boot app.</p>
  
  <p>This is my controller:</p>
  
  <pre><code>@RestController
  public class LoginController {
  
  UserWrapper userWrapper = new UserWrapper();
  
  @RequestMapping(value = "/api/login", method = RequestMethod.POST, headers = "Content-type: application/*")
  public @ResponseBody ResponseEntity getCredentials(@RequestBody UserDTO userDTO) {
  
      User user = userWrapper.wrapUser(userDTO);
      if (userDTO.getPassword().equals(user.getPassword())) {
          return new ResponseEntity(HttpStatus.OK);
      } else {
          return new ResponseEntity(HttpStatus.BAD_REQUEST);
      }
    }
  }
  </code></pre>
  
  <p>I am sending post request at <code>localhost:8080/api/login</code> but it doesn't work. Have you got any idea?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>UserDTO:</p>
  
  <pre><code>public class UserDTO implements Serializable {
  
  private String email;
  private String password;
  //getters and setters
  </code></pre>
  
  <p>And json i send:</p>
  
  <pre><code>{
     "email":"email@email.com",
     "password":"password"
  }
  </code></pre>