title: Parse cookie and add to HTTP request as custom header
body: <p>I have this <code>Axios</code> request:</p>
  <pre><code>public getData&lt;ResponseEntity = any&gt;(path: string, config?: AxiosRequestConfig) {
    return this.axiosInstance.get&lt;ResponseEntity&gt;(path, {
      headers: {
        'x-b3-traceid': traceId,
        'x-b3-spanid': searchId(),
      },
      ...config,
    });
  }
  </code></pre>
  <p>I'd like to make a request where I first parse one of the cookies and send it as a custom header. The below parses the cookie. How do I add it as a header and not overwrite the existing headers that get added?</p>
  <pre><code>getCook(cookiename: string) {
      // Get name followed by anything except a semicolon
      var cookiestring = RegExp(cookiename + '=[^;]+').exec(document.cookie);
      // Return everything after the equal sign, or an empty string if the cookie name not found
      return decodeURIComponent(!!cookiestring ? cookiestring.toString().replace(/^[^=]+./, '') : '');
  }
  
  getCert(policy: string): Promise&lt;string&gt; {
      // default timeout overridden. set to 3 mins for this call as it can be slow to respond
      const cook = this.getCook('mycookie');
      return ApiService.getData(this.apiUrl + policy + this.certEndpoint).then(
        (response) =&gt; response.data
      );
    }
  </code></pre>