title: Fetch API - What's the use of redirect: manual
body: <p>I've recently been playing with the Javascript Fetch API. As far as I understand, by default all redirects are handled transparently and in the end I get a response from the last call in the redirect chain.</p>
  
  <p>However, I could invoke fetch with {redirect: 'manual'}, in which case it would return an opaqueredirect response with no usable information. From <a href="https://fetch.spec.whatwg.org/#concept-filtered-response-opaque-redirect" rel="noreferrer">https://fetch.spec.whatwg.org/#concept-filtered-response-opaque-redirect</a></p>
  
  <blockquote>
    <p>An opaque-redirect filtered response
    is a filtered response whose type is "opaqueredirect", status is 0, status message is the empty byte sequence, header list is empty, body is null, and trailer is empty.</p>
  </blockquote>
  
  <p><a href="https://fetch.spec.whatwg.org/#http-fetch" rel="noreferrer">https://fetch.spec.whatwg.org/#http-fetch</a> says that a response gets to be opaqueredirect if redirect is set to 'manual':</p>
  
  <blockquote>
    <p>Switch on request’s redirect mode:<br/>
    ...<br/>
    - manual<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;Set response to an opaque-redirect filtered response whose internal response is actualResponse. </p>
  </blockquote>
  
  <p>The specification also says:</p>
  
  <blockquote>
    <p>In other words, an opaque filtered response and an opaque-redirect filtered response are nearly indistinguishable from a network error.</p>
  </blockquote>
  
  <p>Given all this, why would one set redirect to manual when using the Fetch API? To me it seems pretty useless. Are there use cases where this would be useful?</p>