R/url_encode_request.R

Defines functions url_encode_request

#' @importFrom utils URLencode
url_encode_request <- function(url, ...) {
    validate_arg(url, required = TRUE, class = 'character', length_min = 1, length_max = 1)

    args <- list(...)
    args <- args[!sapply(args, is.null)]
    args <- sapply(args, as.character, simplify = FALSE)
    args <- sapply(args, utils::URLencode, simplify = FALSE)
    args <- paste(mapply(paste, sep = '=', names(args), args), collapse = '&')

    paste(url, args, sep = '?')
}

Try the ZillowR package in your browser

Any scripts or data that you put into this service are public.

ZillowR documentation built on May 5, 2022, 9:06 a.m.