Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

upload_file

Upload a file with POST() or PUT().


Description

Upload a file with POST() or PUT().

Usage

upload_file(path, type = NULL)

Arguments

path

path to file

type

mime type of path. If not supplied, will be guess by mime::guess_type() when needed.

Examples

citation <- upload_file(system.file("CITATION"))
POST("http://httpbin.org/post", body = citation)
POST("http://httpbin.org/post", body = list(y = citation))

httr

Tools for Working with URLs and HTTP

v1.4.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.