title: angular 4 post request not working, but postman is able to send post request to spring boot server?
body: <p>I am able to successfully send a post request to my restcontroller in spring boot using postman.
  <a href="https://i.stack.imgur.com/DkdvQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DkdvQ.png" alt="enter image description here"></a></p>
  
  <p>The restcontroller is as follows:</p>
  
  <pre><code>@RequestMapping(value="/performaction",method=RequestMethod.POST,consumes = "application/json", produces = "application/json")
      public void performReboot(@RequestBody PerformAction performAction) {
           System.out.println("......rebooting blade to performRebootservice...........for blade id :: : ::"+performAction.getBladeId() +performAction.getActionName());
  
   ..........
      }
  
      @Bean
      public WebMvcConfigurer corsConfigurer() {
          return new WebMvcConfigurerAdapter() {
              @Override
              public void addCorsMappings(CorsRegistry registry) {
                  registry.addMapping("/**").allowedOrigins("*");
              }
          };
      }
  </code></pre>
  
  <p>However I am not able to send this post request from my angular, the request is as follows:</p>
  
  <pre><code>const headers = new HttpHeaders().set("Content-Type", "application/json");
  
      return this.http.post(this.performactionUrl, {"bladeId" : 2,"actionName" : "reboot"},{headers});
  </code></pre>
  
  <p>Note: I have added the WebMvcConfigurer from <a href="https://stackoverflow.com/questions/46065156/access-control-allow-origin-with-spring-boot?utm_medium=organic&amp;utm_source=google_rich_qa">here</a>!</p>
  
  <p>Thanks.</p>