title: Request Headers.append not working
body: <h1>Solution</h1>
  
  <p>I wanted to post the actual modified code and solution. I had to <code>get</code> the <code>Content-Type</code> individually.</p>
  
  <pre><code>const url = 'api/test';
  const result = ApiRequestFactory.build(ApiRequestFactory.MusiQuestApiType, url);
  const contentType = result.headers.get('Content-Type');
  
  expect(result).not.toBeNull('The result is null.');
  expect(result.url).toBe(urlJoin(config.MusiQuestApi.url, 'api/test'), 'The url is incorrect.');
  expect(result.options).toBeFalsy('There is an options object and should not be.');
  expect(result.credentials).toBe('omit', 'The credentials is not set to omit.');
  expect(contentType).toBeTruthy('The Content-Type header is missing.');
  expect(contentType).toBe('application/json', 'The Content-Type header is not set to application/json.');
  expect(result.method).toBe('GET', 'The method is not set to GET.');
  expect(result.mode).toBe('cors', 'The mode is not set to cors.');
  </code></pre>
  
  <h2>Environment</h2>
  
  <ul>
  <li><strong>Test Runner:</strong> Karma</li>
  <li><strong>Test Framework:</strong> Jasmine</li>
  <li><strong>Test Browser:</strong> Chrome</li>
  <li><strong>Fetch Polyfill:</strong> <a href="https://github.com/matthew-andrews/isomorphic-fetch" rel="nofollow noreferrer">isomorphic-fetch</a></li>
  <li><strong>ES6 Promise Library:</strong> <a href="https://github.com/stefanpenner/es6-promise" rel="nofollow noreferrer">es6-promise</a></li>
  </ul>
  
  <h2>Problem</h2>
  
  <p>When testing the object that comes back from <code>defaultHeaders.values()</code> I get an empty object even though I <code>append</code> a header.</p>
  
  <h2>Code</h2>
  
  <p>I have a class that builds a <code>Request</code> object. You can see below it adds a default <code>header</code> for <code>Content-Type</code> when building the object.</p>
  
  <pre><code>export default class MusiQuestApiRequest {
    static build(url, body, options) {
      const defaultCredentials = 'omit';
  
      let defaultHeaders = new Headers();
      defaultHeaders.append('Content-Type', 'application/json');
  
      const defaultMethod = 'GET';
      const defaultMode = 'cors';
  
      let init = {
        credentials: options.credentials || defaultCredentials,
        headers: options.headers || defaultHeaders,
        method: options.method || defaultMethod,
        mode: options.mode || defaultMode
      };
  
      if (body) {
        init.method = options.method || 'POST';
        init.body = JSON.stringify(body);
      }
  
      return new Request(url, init);
    }
  }
  </code></pre>
  
  <p>But when I check for the <code>Content-Type</code> property on the <code>values</code> object I get undefined because the <code>values</code> object returned is empty.</p>
  
  <pre><code>const url = 'api/test';
  const result = ApiRequestFactory.build(ApiRequestFactory.MusiQuestApiType, url);
  const headersResult = result.headers.values();
  console.log('headersResult:', JSON.stringify(headersResult));
  
  expect(result).not.toBeNull();
  expect(result.url).toBe(urlJoin(config.MusiQuestApi.url, 'api/test'));
  expect(result.options).toBeFalsy();
  expect(result.credentials).toBe('omit');
  expect(headersResult).toBeTruthy('headers missing');
  expect(headersResult['Content-Type']).toBeTruthy('Content-Type missing');
  expect(headersResult['Content-Type']).toBe('application/json');
  expect(result.method).toBe('GET');
  expect(result.mode).toBe('cors');
  </code></pre>
  
  <p>What did I do wrong here? Seems pretty straight forward.</p>