httr (version 0.1.1)

POST: Post file to a server.

Description

Post file to a server.

Usage

POST(url = NULL, config = list(), body = NULL,
    multipart = TRUE, ..., handle = NULL)

Arguments

body
Use NULL for an empty body, a length-one character or file. Each component should either be a character value or the object returned by fileUpload (if you want to upload a file)
multipart
Should the form be send as multipart/form-data (TRUE), or application/x-www-form-urlencoded (FALSE). Files can not be uploaded when FALSE.
url
the url of the page to retrieve
config
Additional configuration settings such as http authentication (authenticate), additional headers (add_headers), cookies (
...
Further parameters, such as query, path, etc, passed on to modify_url. These parameters must be named.
handle
The handle to use with this request. If not supplied, will be retrieved and reused from the handle_pool based on the scheme, hostname and port of the url. By default httr requests to

Examples

Run this code
b <- new_bin()
POST(b)
POST(b, body = "A simple text string")
POST(b, body = list(a = 1, b = 2, c = 3))
POST(b, body = list(a = 1, file = upload_file(system.file("CITATION"))))

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"))))

Run the code above in your browser using DataLab