tests/testthat/test-upload.R

context("Upload File")

test_that("File upload", {
  file <- system.file('DESCRIPTION', package = 'curl')
  res <- curl_upload(file, httpbin('/anything'), verbose = FALSE)
  data <- jsonlite::parse_json(rawToChar(res$content))$data
  input <- rawToChar(readBin(file, raw(), file.info(file)$size))
  expect_identical(data, input)
})

Try the curl package in your browser

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

curl documentation built on Sept. 30, 2024, 9:35 a.m.