Send PUT request to server.
PUT( url = NULL, config = list(), ..., body = NULL, encode = c("multipart", "form", "json", "raw"), handle = NULL )
url | the url of the page to retrieve |
---|---|
config | Additional configuration settings such as http
authentication ( |
... | Further named parameters, such as |
body | One of the following:
|
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 |
POST("http://httpbin.org/put")#> Response [http://httpbin.org/put] #> Date: 2020-08-17 22:22 #> Status: 405 #> Content-Type: text/html #> Size: 178 B #> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> #> <title>405 Method Not Allowed</title> #> <h1>Method Not Allowed</h1> #> <p>The method is not allowed for the requested URL.</p>PUT("http://httpbin.org/put")#> Response [http://httpbin.org/put] #> Date: 2020-08-17 22:22 #> Status: 200 #> Content-Type: application/json #> Size: 457 B #> { #> "args": {}, #> "data": "", #> "files": {}, #> "form": {}, #> "headers": { #> "Accept": "application/json, text/xml, application/xml, */*", #> "Accept-Encoding": "deflate, gzip", #> "Content-Length": "0", #> "Host": "httpbin.org", #> ...b2 <- "http://httpbin.org/put" PUT(b2, body = "A simple text string")#> Response [http://httpbin.org/put] #> Date: 2020-08-17 22:22 #> Status: 200 #> Content-Type: application/json #> Size: 478 B #> { #> "args": {}, #> "data": "A simple text string", #> "files": {}, #> "form": {}, #> "headers": { #> "Accept": "application/json, text/xml, application/xml, */*", #> "Accept-Encoding": "deflate, gzip", #> "Content-Length": "20", #> "Host": "httpbin.org", #> ...#> Response [http://httpbin.org/put] #> Date: 2020-08-17 22:22 #> Status: 200 #> Content-Type: application/json #> Size: 589 B #> { #> "args": {}, #> "data": "", #> "files": {}, #> "form": { #> "x": "A simple text string" #> }, #> "headers": { #> "Accept": "application/json, text/xml, application/xml, */*", #> "Accept-Encoding": "deflate, gzip", #> ...#> Response [http://httpbin.org/put] #> Date: 2020-08-17 22:22 #> Status: 200 #> Content-Type: application/json #> Size: 1.6 kB #> { #> "args": {}, #> "data": "", #> "files": { #> "y": "bibentry(\"Manual\",\n title = \"R: A Language and Environm... #> }, #> "form": {}, #> "headers": { #> "Accept": "application/json, text/xml, application/xml, */*", #> "Accept-Encoding": "deflate, gzip", #> ...#> Response [http://httpbin.org/put] #> Date: 2020-08-17 22:22 #> Status: 200 #> Content-Type: application/json #> Size: 564 B #> { #> "args": {}, #> "data": "{\"x\":\"A simple text string\"}", #> "files": {}, #> "form": {}, #> "headers": { #> "Accept": "application/json, text/xml, application/xml, */*", #> "Accept-Encoding": "deflate, gzip", #> "Content-Length": "28", #> "Content-Type": "application/json", #> ...