Last chance! 50% off unlimited learning
Sale ends in
POST(url = NULL, config = list(), ..., body = NULL,
encode = c("multipart", "form", "json"), multipart = TRUE,
handle = NULL)
authenticate
), additional headers
(add_headers
), cookies (
query
, path
, etc,
passed on to modify_url
. Unnamed parameters will be combined
with config
.FALSE
: No bodyNULL
: An empty body""
: A length 0 bodyupload_file("path/")
: The contents of a file. The mime
type will be guessed from the exteFor "multipart", list elements can be strings or objects created by
TRUE
= encode = "multipart"
,
FALSE
= {encode = "form"}.
Files can not be uploaded when FALSE
.handle_pool
based on the scheme, hostname and port of the url. By default b2 <- "http://httpbin.org/post"
POST(b2, body = "A simple text string")
POST(b2, body = list(x = "A simple text string"))
POST(b2, body = list(y = upload_file(system.file("CITATION"))))
POST(b2, body = list(x = "A simple text string"), encode = "json")
# Various types of empty body:
POST(b2, body = NULL, verbose())
POST(b2, body = FALSE, verbose())
POST(b2, body = "", verbose())
Run the code above in your browser using DataLab