http4s / http4s-dom

http4s, in a browser near you

Home Page:https://http4s.github.io/http4s-dom/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support streaming requests

armanbilge opened this issue · comments

https://developer.chrome.com/articles/fetch-streaming-requests/

This will require some sort of feature test:

 const supportsRequestStreams = (() => {
    let duplexAccessed = false;
    
    const hasContentType = new Request('', {
      body: new ReadableStream(),
      method: 'POST',
      get duplex() {
        duplexAccessed = true;
        return 'half';
      },
    }).headers.has('Content-Type');
    
    console.log({ duplexAccessed, hasContentType });
    
    return duplexAccessed && !hasContentType;
  })();

Crap, that feature test might only work for Chrome.