httr (version 0.5)

upload_file: Upload a file with POST or PUT.

Description

This is a tiny wrapper for RCurl's fileUpload.

Usage

upload_file(path, type = NULL)

Arguments

path
path to file
type
mime type of path. If not supplied, will be guess by guess_media when needed.

Examples

Run this code
POST("http://httpbin.org/post",
  body = list(y = upload_file(system.file("CITATION"))))

Run the code above in your browser using DataCamp Workspace