http
Make HTTP Requests

Description

Makes an HTTP request to a URL.

Usage

http.get(url, headers = character(0), options = character(0))
http.post(url, body, headers = character(0), options = character(0))
http.put(url, body, headers = character(0), options = character(0))
http.delete(url, headers = character(0), options = character(0))

Arguments

url a character string containing the URL to request.
body a character string or raw vector containing the body of the HTTP request to make.
headers a named character vector or list containing HTTP headers to add to the request.
options a named character vector or list specifying various option values used when sending the request. The option "response.file" specifies a string file name where the response body will be stored. The option "authentication" specifies the authentication to use: currently the only value accepted is the string "NTLM". The options "username" and "password" specify the user name and password to use when authentication is used.
Value
Returns a list representing the HTTP response that contains the following members
bodya character string or raw vector containing the body of the response. If the "response.file" option is given, the body of the response is stored in the file, and this member is the empty string.
statusan integer value containing the HTTP status code of the response.
headersa list containing the HTTP headers of the response.
See Also
url, ssl.ca.bundle
Examples
## Not run: 
http.get("http://www.google.com")
http.post("http://httpbin.org/post", "This is a test.", c(`Content-Type` = "text/plain", `X-Codeword` = "alpha"))
http.put("http://httpbin.org/put", "<?xml version=\"1.0\"><Test>Another test.</Test>", list(`Content-Type` = "text/xml", `X-Codeword` = "beta"))
http.delete("http://httpbin.org/delete", c(`Auth-Token` = "12345"))

## End(Not run)
Package terrUtils version 6.1.4-13
Package Index