pub enum Body {
None,
JsonFields(Vec<Field>),
JsonWhole {
required: bool,
},
Multipart {
names: Vec<String>,
required: bool,
},
Opaque {
media_type: String,
required: bool,
},
}Expand description
What the operation wants in the request body — and therefore which flags the subcommand grows. Each variant is exactly one flag set, so a body can never offer a flag that the request builder then ignores.
Variants§
None
The document asks for no body.
JsonFields(Vec<Field>)
A JSON object whose every property is a scalar: one flag per property,
plus --json-body as a base document to merge them over.
JsonWhole
JSON this CLI will not take apart — a nested object, an array, anything
but an object of scalars. --json-body only, and no dead per-field
flags beside it.
Multipart
multipart/form-data: assembled from --file name=@path and
--field name=value. names is what the document declares, for the
help line; the CLI accepts any part name, because a document that
declares none (or misdeclares them) is common and refusing would help
nobody.
Opaque
A media type this CLI does not assemble. --raw-body FILE sends the
bytes verbatim under this Content-Type — and a media type is what it
is, because a content key that is not one is refused while the
document is reduced rather than carried here.