title: Spring post method "Required request body is missing"
body: <pre><code>@PostMapping(path="/login")
  public ResponseEntity&lt;User&gt; loginUser(@RequestBody Map&lt;String, String&gt; userData) throws Exception {
      return ResponseEntity.ok(userService.login(userData));
  }
  </code></pre>
  
  <p>I have this method for the login in the UserController. The problem is when i try to make the post request for the login i get this error:</p>
  
  <pre><code>{
  "timestamp": "2018-10-24T16:47:04.691+0000",
  "status": 400,
  "error": "Bad Request",
  "message": "Required request body is missing: public org.springframework.http.ResponseEntity&lt;org.scd.model.User&gt; org.scd.controller.UserController.loginUser(java.util.Map&lt;java.lang.String, java.lang.String&gt;) throws java.lang.Exception",
  "path": "/users/login"
  }
  </code></pre>
  
  <hr>
  
  <p><a href="https://i.stack.imgur.com/yb8WK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/yb8WK.png" alt="enter image description here"></a> </p>