Re: [whatwg/fetch] Support Structured Field Values in the Headers API (#930)

This topic came up in the HTTP Workshop and it made me think about the requirements some more. The complicated piece here are the getters from an ergonomics perspective (as for the setter you can rely on the type of the value). There's three separate types and for the return values there's parameters. Returning the value without parameters is useful and often what you want. Taken together this might suggest something like:

```webidl
typedef (boolean or long long or double or ByteString or Uint8Array) SFBareItem; // TODO: distinguish Token and String

interface Headers {
  SFBareItem getItem(ByteString name);
  SFItem getFullItem(ByteString name);
  …
};
```
(There's a question of course as to how much header processing happens in client-side JS to begin with. Perhaps this can be a library first.)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/930#issuecomment-1301698813

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/930/1301698813@github.com>

Received on Thursday, 3 November 2022 06:34:08 UTC