title: fetch API don't return same return of XMLHttpRequest
body: <p>I would like convert XMLHttpRequest function to fetch API. But the result is different.</p>
  
  <p>There are some things I have to do wrong, but i don't know what :/</p>
  
  <p>My promise with XMLHttpRequest :</p>
  
  <pre><code>  return new Promise(function (resolve, reject) {
  
      let formData = new FormData($searchForm);
  
      if (searchTerm.length) {
        formData.append("search", searchTerm);
      }
  
      let request = new XMLHttpRequest();
  
      request.onreadystatechange = function () {
        if (request.readyState === XMLHttpRequest.DONE &amp;&amp; request.status === 200) {
          console.log(request);
          resolve(request.responseText);
        }
      };
  
      request.open($searchForm.method, $searchForm.action, true);
      request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
      request.send(formData);
  
    });
  </code></pre>
  
  <p>return (what i want) :</p>
  
  <blockquote>
    <p>XMLHttpRequest { onreadystatechange:
    reload/http://localhost:3000/app_dev.php/r…", status: 200, statusText: "OK",
    responseType: "", response: "{"countMessage":"No product find" }</p>
  </blockquote>
  
  <p>And my function with <strong>fetch API</strong> :</p>
  
  <pre><code>function searchReload() {
  
    const formData = new FormData($searchForm);
    const url = $searchForm.action;
    const method = $searchForm.method;
  
    if (searchTerm.length) {
      formData.append('search', searchTerm);
    }
  
    const header = new Headers();
    header.append('X-Requested-With', 'XMLHttpRequest');
  
    return fetch(url, {
      method: method,
      header,
      body: formData
    }).then(function (response) {
      return response;
    });
  
  }
  
  searchReload()
    .then(response =&gt; {
      return console.log(response);
    });
  </code></pre>
  
  <p>This function return :</p>
  
  <blockquote>
    <p>Response { type: "basic", url: "<a href="http://localhost:3000/app_dev.php/r" rel="nofollow noreferrer">http://localhost:3000/app_dev.php/r</a>…",
    redirected: false, status: 200, ok: true, statusText: "OK", headers:
    Headers, bodyUsed: false }</p>
  </blockquote>
  
  <p>Anyone can help me ? I don't know what is the problem, and why i can't have <strong>response: "{"countMessage":"No product find" }</strong> to my response :(</p>
  
  <p>Thank you community ! </p>