title: Test rest service having RequestParam using postman
body: <p>I want to test my REST service in order to save a product having a certain category (manyToOne) with Postman:</p>
  
  <p>This is the body of my request:</p>
  
  <pre><code>{
      "categoryId": 36,
      "product": {
          "code": "code1",
          "name": "product1",
          "price": 20
      }
  }
  </code></pre>
  
  <p>And this is how the signature of my REST service method looks like:</p>
  
  <pre><code>@RequestMapping(value = "/addProduct", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
  public ResponseEntity&lt;ProductBean&gt; add(@RequestParam(value ="categoryId") Long id, @RequestParam(value = "product") ProductBean productBean)
  </code></pre>
  
  <p>I put in Postman my URL with the <code>/addProduct</code> at the end, then I choose <code>POST</code>. In the body tab, I choose <code>raw</code> and select the <code>JSON (application json)</code>.
  When I send the request I got HTTP 400. </p>
  
  <p>How can test this without error in Postman?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>I want to test it using postman to be sure that my REST is working before adding the front part. This is how I will send the data from the front</p>
  
  <pre><code>add: function (product, id, successCallBack, failureCallBack) {
          $http({
              method: 'POST',
              url: "/addProduct",
              params: {
                  product: product,
                  categoryId: id
              },
              headers: {'Content-Type': 'application/json'}
          }).then(successCallBack, failureCallBack);
      }
  </code></pre>