Learn R Programming

httr (version 1.2.1)

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 guess_type when needed.

Examples

Run this code
# NOT RUN {
citation <- upload_file(system.file("CITATION"))
POST("http://httpbin.org/post", body = citation)
POST("http://httpbin.org/post", body = list(y = citation))
# }

Run the code above in your browser using DataLab