get_message_body: Message body

View source: R/operations.R

get_message_bodyR Documentation

Message body

Description

Transform a list of operation arguments to an http request message body. This method searches for parameters with swagger / openAPI specification 'in: body' or 'in: formData'. 'body' parameters are expected to be R vectors or lists, and are transformed to JSON using 'jsonlite::toJSON()'. 'formData' parameters are treated as is, so must be specified (e.g., using 'httr::upload_file()') by the caller. Interpretation of 'formData' parameters require that the 'op_def' includes 'consumes: multipart/form-data'.

Usage

get_message_body(op_def, x)

Arguments

op_def

A list representation of the swagger / openAPI description of the operation.

x

A list representation of the operation arguments provided by the user.

Value

A JSON character representation (for 'body') or list of objects (for 'formData') representing the parameters 'x'.


bergant/rapiclient documentation built on May 15, 2022, 1:17 a.m.