OptionalbodyRequest body. Carried VERBATIM for every byte-ish shape, but the
content-type default differs between them: a Uint8Array and an
ArrayBuffer get NONE, since only the caller knows whether those bytes
are multipart, JSON, or an image, while a Blob DECLARES its own and
contributes a non-empty .type as the default — matching the platform,
whose new Request(url, { body: blob }) sets the header from it and omits
it when the blob has none. A URLSearchParams is serialised with its own
toString() and defaults the content type to
application/x-www-form-urlencoded; a plain object is JSON-serialised and
a bare string is carried as-is, both defaulting to application/json.
An explicitly supplied content type always wins, and the default is
written onto a COPY of headers, so a Headers instance reused across
two injected requests is never mutated.
Any other shape — an array, a Date, a class instance, a number — is
REFUSED with a TypeError naming the received type, rather than silently
JSON-stringified as before (which turned a Uint8Array into
{"0":97,…} and every other non-string into {}).
The last arm is deliberately Record<string, unknown>, not object:
object admits arrays, Dates, streams and every class instance, so the
union would go on accepting exactly the values that used to silently
JSON-coerce.
OptionalheadersRequest headers.
OptionalipSocket peer to carry into IRequest.ip; omitted by default.
HTTP method.
Full request URL.
Inject request shape for
IKernelApplication.inject.Since
0.1.0