Skip to content

Commit

Permalink
Clarify .multi option
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Dec 20, 2024
1 parent fdacb85 commit 962d50a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
3 changes: 2 additions & 1 deletion R/req-body.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ req_body_json_modify <- function(req, ...) {
#' data in the body.
#'
#' * For `req_body_form()`, the values must be strings (or things easily
#' coerced to strings);
#' coerced to strings). Vectors are convertd to strings using the
#' value of `.multi`.
#' * For `req_body_multipart()` the values must be strings or objects
#' produced by [curl::form_file()]/[curl::form_data()].
#' * For `req_body_json_modify()`, any simple data made from atomic vectors
Expand Down
7 changes: 4 additions & 3 deletions R/req-url.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ req_url <- function(req, url) {
#' * `"error"`, the default, throws an error.
#' * `"comma"`, separates values with a `,`, e.g. `?x=1,2`.
#' * `"pipe"`, separates values with a `|`, e.g. `?x=1|2`.
#' * `"explode"`, turns each element into its own parameter, e.g. `?x=1&x=2`.
#' * `"explode"`, turns each element into its own parameter, e.g. `?x=1&x=2`
#'
#' If none of these functions work, you can alternatively supply a function
#' that takes a character vector and returns a string.
#' If none of these options work for your needs, you can instead supply a
#' function that takes a character vector of argument values and returns a
#' a single string.
req_url_query <- function(.req,
...,
.multi = c("error", "comma", "pipe", "explode")) {
Expand Down
10 changes: 6 additions & 4 deletions man/req_body.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions man/req_url.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 962d50a

Please sign in to comment.