reqwest.form

reqwest.form

reqwest.form

Function

Set application/x-www-form-urlencoded form request body.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
valuesObjectNoNoneForm field mapping object; rules for keys and values are below.

values object structure

keyvalue typedescription
Form field nameAnyThe field value to be written into the application/x-www-form-urlencoded request body; it will be converted to a string when called.

Return value

TypeDescription
ReqwestReturns the new request builder.

Example

Notes

  • values must be objects, otherwise an error will be reported.
  • Body, json, form, and multipart will all set the request body; the last request body set in the same request will take effect.