title: Angular 6 HTTP 409 Conflict when requesting a url with httpclient with authorization header
body: <p>I'm deveoping an Angular 6 application that will request some data from a  remote api.I'm using HttpClient to obtain access_token.</p>
  
  <p>However when I do a post request using the authorization header that contains the access_token,I receive HTTP 409 CONFLICT:</p>
  
  <p>Failed to load resource: the server responded with a status of 409 (Conflict) [...SOME URL...]</p>
  
  <p>Here is part of the api.service.ts file which is the service class of the application:</p>
  
  <pre class="lang-js prettyprint-override"><code>@Injectable({
    providedIn: 'root'
  })
  export class ApiService {
  
    constructor(private http:HttpClient) {}
    apiURL:string="SOME URL";
    tokenURL:string="SOME URL";
  
    getSurveys(){
      var tokenData={
        "username": "...",
        "password": "...",
        "client_type": 1
        }
  
        this.http.post(this.tokenURL,tokenData).subscribe((res)=&gt;{    
          var access_token=res["access_token"];
          var header = {
            headers: new HttpHeaders()
              .append('Content-Type','application/json')
              .append('Authorization', `bearer ${access_token}`)
          }
  
          var requestData={
            "skip":1,
            "take":2,
            "search":""
          }
  
          this.http.post(this.apiURL,requestData,header).subscribe((res)=&gt; 
          {
              alert(res);
          });
  
        });       
    }
  }
  </code></pre>
  
  <p>I can receive the access_token from the first request.I expect to receive the response from the second Http post request and that the application alerts the response message.</p>