RequestBody
public enum RequestBody
The data sent as the message body of a request, such as for an HTTP POST request.
See
See Also:GetContentsOfURL
-
A JSON request body.
Attention
null
values are not supported by the Shortcuts app.Declaration
Swift
case json([(key: Text, value: DictionaryValue)])
-
A multipart form request body.
Declaration
Swift
case form([(key: Text, value: MultipartFormValue)])
-
A raw data payload.
Declaration
Swift
case file(Variable)
-
This convenience constructor converts the ordered KeyValuePairs collection into an Array of tuples.
Declaration
Swift
public static func json(_ payload: KeyValuePairs<Text, DictionaryValue>) -> RequestBody
Parameters
payload
The payload of the request body, expressed as a dictionary literal.
Return Value
A JSON request body.
-
This convenience constructor converts the ordered KeyValuePairs collection into an Array of tuples.
Declaration
Swift
public static func form(_ payload: KeyValuePairs<Text, MultipartFormValue>) -> RequestBody
Parameters
payload
The payload of the request body, expressed as a dictionary literal.
Return Value
A multipart form request body.