Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

httpPUT

Simple high-level functions for HTTP PUT and DELETE


Description

These two functions are simple, high-level functions that implement the HTTP request methods PUT and DELETE. These can also be done by specifying the method type using the curl option customrequest. These functions merely provide a convenience wrapper for getURLContent with the HTTP method specified.

Usage

httpPUT(url, content,  ..., curl = getCurlHandle())
httpPOST(url, ..., curl = getCurlHandle())
httpDELETE(url, ..., curl = getCurlHandle())
httpGET(url, ..., curl = getCurlHandle())
httpHEAD(url, ..., curl = getCurlHandle())
httpOPTIONS(url, ..., curl = getCurlHandle())

Arguments

url

the URL of the server to which the HTTP request is to be made

content

the value that is to be used as the content of the PUT request. This can be a character or a raw object.

...

additional arguments passed to getURLContent

curl

the curl handle to be used to make the request

Value

The content returned by the server as a result of the request.

Author(s)

Duncan Temple Lang

See Also

Examples

## Not run: 
   # create a database in a CouchDB server
 httpPUT("http://127.0.0.1:5984/temp_db")

   # Insert an entry into an ElasticSearch dabtabase.
 httpPUT("http://localhost:9200/a/b/axyz", '{"abc" : 123}')

   # Then delete the database
 httpDELETE("http://127.0.0.1:5984/temp_db")

## End(Not run)

RCurl

General Network (HTTP/FTP/...) Client Interface for R

v1.98-1.3
BSD_3_clause + file LICENSE
Authors
CRAN Team [ctb, cre] (de facto maintainer since 2013), Duncan Temple Lang [aut] (<https://orcid.org/0000-0003-0159-1546>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.