Re: [whatwg/fetch] Trailer support in the API (#981)

Maybe when calling the constructor, you specify a callback for `trailers`, which is invoked after the stream is done, and returns the trailer map at that point:

```
 const response = new Response('I am a body', {
  headers: {
   'Trailer': 'animal'
  },
  trailers: () => { return { animal: animal } }
 });
```

On the receiving end, invoking `response.trailers()` before reading the entire body is an error.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/981#issuecomment-1642710542
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/981/1642710542@github.com>

Received on Wednesday, 19 July 2023 20:29:03 UTC