MCPcopy
hub / github.com/sindresorhus/got / serializeNativeFormDataBody

Function serializeNativeFormDataBody

source/core/index.ts:203–209  ·  view source on GitHub ↗
(form: FormData)

Source from the content-addressed store, hash-verified

201};
202
203const serializeNativeFormDataBody = (form: FormData) => {
204 const response = new globalThis.Response(form);
205 return {
206 body: response.body!,
207 contentType: response.headers.get('content-type') ?? 'multipart/form-data',
208 };
209};
210
211// A body is replayable only if iterating it again restarts from the beginning.
212// Node streams, Web `ReadableStream`s, generators, and self-iterating (one-shot) iterators all yield their data only once, so they cannot be replayed on a redirect.

Callers 2

_finalizeBodyMethod · 0.85
_onResponseBaseMethod · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…