Function bodyParam
Declare that a parameter will be transmitted to the API through the body.
WebParamAttribute bodyParam
(
string identifier,
string field
) @safe;
WebParamAttribute bodyParam
(
string identifier
) @safe;
It will be serialized as part of a JSON object. The serialization format is currently not customizable. If no fieldname is given, the entire body is serialized into the object.
Parameters
Name | Description |
---|---|
identifier | The name of the parameter to customize. A compiler error will be issued on mismatch. |
field | The name of the field in the JSON object. ---- @bodyParam("pack", "package") void ship(int pack); // The server will receive the following body for a call to ship(42): // { "package": 42 } ---- |