title: Set cookie on the header of a POST request using angular4 service
body: <p>I would like to pass some cookies through the HTTP POST requests header using angular4. Here I am calling an external API and trying to pass this particular cookie. I've googled but I do not yet get any correct solution. Please help me for the same. The following are the codes I've tried.</p>
  
  <pre><code>public getTransactionStatus(transactionID: string): Promise&lt;any&gt; {
      let header = new Headers;
      let body = { "transactionID": "123" };
      header.append('content-type', 'application/json');
      header.append('set-cookie', 'test=hi; FedAuth=sadsa54ea4da5');
      return this.http.post(uri, body, { headers: header })
        .toPromise()
        .then((res) =&gt; {
          let temp = res.json();
          return { 'statusCode': 200, 'message': 'success', 'result': temp, 'error': {} };
        })
        .catch((error) =&gt; {
          return { 'statusCode': 200, 'message': 'failed', 'result': {}, 'error': error };
        });
    }
  </code></pre>