httr (version 1.1.0)

VERB: VERB a url.

Description

Use an arbitrary verb.

Usage

VERB(verb, url = NULL, config = list(), ..., body = NULL,
  encode = c("multipart", "form", "json"), handle = NULL)

Arguments

verb
Name of verb to use.
url
the url of the page to retrieve
config
Additional configuration settings such as http authentication (authenticate), additional headers (add_headers), cookies (
...
Further named parameters, such as query, path, etc, passed on to modify_url. Unnamed parameters will be combined with config.
body
One of the following:
  • FALSE: No body
  • NULL: An empty body
  • "": A length 0 body
  • upload_file("path/"): The contents of a file. The mime type will be guessed from the exte
encode
If the body is a named list, how should it be encoded? Can be one of form (application/x-www-form-urlencoded), multipart, (multipart/form-data), or json (application/json).

For "multipart", list elements can be strings or objects created by

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 the same

See Also

Other http methods: BROWSE, DELETE, GET, HEAD, PATCH, POST, PUT

Examples

Run this code
r <- VERB("PROPFIND", "http://svn.r-project.org/R/tags/",
  add_headers(depth = 1), verbose())
stop_for_status(r)
content(r)

VERB("POST", url = "http://httpbin.org/post")
VERB("POST", url = "http://httpbin.org/post", body = "foobar")

Run the code above in your browser using DataCamp Workspace