| 1 |
\name{httpPUT} |
| 2 |
\alias{httpPUT} |
| 3 |
\alias{httpPOST} |
| 4 |
\alias{httpGET} |
| 5 |
\alias{httpDELETE} |
| 6 |
\alias{httpHEAD} |
| 7 |
\alias{httpOPTIONS} |
| 8 |
\title{Simple high-level functions for HTTP PUT and DELETE} |
| 9 |
\description{ |
| 10 |
These two functions are simple, high-level functions |
| 11 |
that implement the HTTP request methods PUT and DELETE. |
| 12 |
These can also be done by specifying the method |
| 13 |
type using the curl option \code{customrequest}. |
| 14 |
These functions merely provide a convenience |
| 15 |
wrapper for \code{\link{getURLContent}} |
| 16 |
with the HTTP method specified. |
| 17 |
} |
| 18 |
\usage{ |
| 19 |
httpPUT(url, content, ..., curl = getCurlHandle()) |
| 20 |
httpPOST(url, ..., curl = getCurlHandle()) |
| 21 |
httpDELETE(url, ..., curl = getCurlHandle()) |
| 22 |
httpGET(url, ..., curl = getCurlHandle()) |
| 23 |
httpHEAD(url, ..., curl = getCurlHandle()) |
| 24 |
httpOPTIONS(url, ..., curl = getCurlHandle()) |
| 25 |
} |
| 26 |
\arguments{ |
| 27 |
\item{url}{the URL of the server to which the HTTP request is to be |
| 28 |
made} |
| 29 |
\item{content}{the value that is to be used as the content of the |
| 30 |
\code{PUT} request. This can be a character or a \code{raw} object.} |
| 31 |
\item{\dots}{additional arguments passed to \code{\link{getURLContent}}} |
| 32 |
\item{curl}{the curl handle to be used to make the request} |
| 33 |
} |
| 34 |
\value{ |
| 35 |
The content returned by the server as a result of the request. |
| 36 |
} |
| 37 |
\author{ |
| 38 |
Duncan Temple Lang |
| 39 |
} |
| 40 |
|
| 41 |
\seealso{ |
| 42 |
\code{\link{getURLContent}} |
| 43 |
} |
| 44 |
\examples{ |
| 45 |
\dontrun{ |
| 46 |
# create a database in a CouchDB server |
| 47 |
httpPUT("http://127.0.0.1:5984/temp_db") |
| 48 |
|
| 49 |
# Insert an entry into an ElasticSearch dabtabase. |
| 50 |
httpPUT("http://localhost:9200/a/b/axyz", '{"abc" : 123}') |
| 51 |
|
| 52 |
# Then delete the database |
| 53 |
httpDELETE("http://127.0.0.1:5984/temp_db") |
| 54 |
} |
| 55 |
} |
| 56 |
\keyword{programming} |
| 57 |
\concept{HTTP} |