Core
struct.formData
Object struct that is encoded as multipart FormData when it is the request body.
@defjs/core · Function
Signature
function formData<T extends ObjectShape>( shape: T, ): ObjectStruct<T>;
Parses like struct.object(), and carries a formData codec tag.
-
The tag applies only when this struct's value is the request body root. The body is then sent as
FormDatawith a platform multipart boundary. -
Arrays repeat the field name,
undefinedfields are skipped, andBlob/Filevalues are appended as files. A nested object fails the request withREQ_BUILD_FAILED. -
struct.parseignores the tag. It does not accept aFormDatainstance, only a plain object.
Parameters
Prop
Type
shape T