title: the server responded with a status of 403 (Forbidden) angular
body: <p>When I try to call with <code>this.http.get</code> and <code>@GetMapping</code> I am able to send the call to spring controller,</p>
  
  <p>When I try to change from <code>this.http.get</code> to <code>this.http.post</code> and from  <code>@GetMapping</code> to  <code>@PostMapping</code> I am not able to call the spring controller <code>/api/v1/basicauth</code> method.</p>
  
  <p>As I am having username and password I want to use <code>PostMapping</code> only</p>
  
  <p>My code as below:-</p>
  
  <p><strong>Angular</strong></p>
  
  <pre><code>var formData: any = new FormData();
  formData.append("userName", username);
  formData.append("password", password);
  
  let params = new HttpParams();
  params = params.append('username', username);
  params = params.append('password', password);
  return this.http.post&lt;any&gt;('/api/v1/basicauth', { formData }).pipe(map((res) =&gt; {
      this.username = username;
      this.password = password;
  }));
  </code></pre>
  
  <p><strong>Spring boot:-</strong></p>
  
  <pre><code>@PostMapping(path = "/basicauth")
  public AuthenticationBean helloWorldBean(@RequestBody UserDetails user) {
  log.info("Start helloWorldBean method");
  </code></pre>
  
  <p><strong>UserDetails.java</strong></p>
  
  <pre><code>    public class UserDetails {
  
          private int userId;
          private String userName;
          private String password;
     }
  </code></pre>