File: httpPUT.Rd

package info (click to toggle)
r-cran-rcurl 1.95-4.8-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,140 kB
  • ctags: 515
  • sloc: ansic: 3,135; xml: 1,734; asm: 993; sh: 12; makefile: 2
file content (57 lines) | stat: -rw-r--r-- 1,669 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
\name{httpPUT}
\alias{httpPUT}
\alias{httpPOST}
\alias{httpGET}
\alias{httpDELETE}
\alias{httpHEAD}
\alias{httpOPTIONS}
\title{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 \code{customrequest}.
  These functions merely provide a convenience
  wrapper for \code{\link{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{
  \item{url}{the URL of the server to which the HTTP request is to be
    made}
  \item{content}{the value that is to be used as the content of the
    \code{PUT} request. This can be a character or a \code{raw} object.}
  \item{\dots}{additional arguments passed to \code{\link{getURLContent}}}
  \item{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{
Duncan Temple Lang
}

\seealso{
\code{\link{getURLContent}}
}
\examples{
\dontrun{
   # 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")
}
}
\keyword{programming}
\concept{HTTP}