title: Spring MVC - REST Api, keep getting 400 Bad Request when trying to POST
body: <p>i have a REST api service which should receive POST calls.</p>
  
  <p>I'm using POSTMAN to test them, but i keep getting a 400 Bad Request Error, with no body, maybe i'm building bad my controller...</p>
  
  <p>This is the controller</p>
  
  <pre><code>@PostMapping("/object/delete")
      public ResponseEntity&lt;?&gt; deleteObject(@RequestBody long objectId) {
          logger.debug("controller hit");
          Object o = service.findByObjectId(objectId);
          if(o!=null){
  
          service.deleteObject(object);
  
          return new ResponseEntity&lt;&gt;(HttpStatus.OK);
                     }
  
          return new ResponseEntity&lt;&gt;(HttpStatus.NOT_FOUND);
  
      }
  </code></pre>
  
  <p>Using <code>@RequestBody</code> i should send the request in JSON, in this way:</p>
  
  <pre><code>{
  "objectId":100
  }
  </code></pre>
  
  <p>But i get a 400 error, and the strange think is that my logger <code>logger.debug("controller hit");</code> it's not printed in logs...</p>