Core
struct.urlencoded
Object struct that is encoded as an URL-encoded form when it is the request body.
@defjs/core · Function
Signature
function urlencoded<T extends ObjectShape>( shape: T, ): ObjectStruct<T>;
Parses like struct.object(), and carries a urlencoded codec tag.
-
The tag applies only when this struct's value is the request body root. The body is then sent as
URLSearchParamswithapplication/x-www-form-urlencoded;charset=UTF-8. -
Arrays repeat the field name and
undefinedfields are skipped. A nested object or aBlobfails the request withREQ_BUILD_FAILED. -
struct.parseignores the tag. It does not accept aURLSearchParamsinstance, only a plain object.
Parameters
Prop
Type
shape T