[whatwg/fetch] Structured clone body serialization (#1234)

In the spirit of `.json()`, could we make some enhancements to `Body` that behave more like structured clone? The goal would be more seamless handling of `ArrayBuffer, Date, BigInt`, cycles, etc. 

This would require a standard binary format. CBOR is a good fit since its tag mechanism can support cycles and current and future data types.

The api might look like:
- New property `bodyCBOR` on `RequestInit/ResponseInit` so as not to conflict with the semantics of the `body` property
- `.cbor()` method on `Body`
- Feature detection that exposes supported tags (data types) for future proofing 



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

Received on Thursday, 13 May 2021 18:11:23 UTC