Skip to content

BodyKind

reference
1 min readUpdated

Kind: Type

Source: atloria-monorepo/packages/ui-core/src/components/api-explorer/multipart.ts

What an operation's request body actually IS, and what a reader needs on screen to supply it.

The playground read exactly one media type — application/json — and offered a textarea for everything. An operation declaring multipart/form-data therefore rendered a JSON box that could never produce a valid upload, with nothing on screen saying so: the reader typed something plausible and got a 400 back. Two of this API's own controllers are in that state.

Kept as pure functions with no Lit dependency so the shape can be tested, and so the request panel, the code samples and the send path all read the SAME answer rather than each re-deriving it from the spec and disagreeing.

Definition

ts
'none' | 'json' | 'multipart' | 'binary'

Was this page helpful?

Download as PDF