Use an arbitrary verb.
VERB(verb, url = NULL, config = list(), ..., body = NULL, encode = c("multipart", "form", "json", "raw"), handle = NULL)
| verb | Name of verb to use. |
|---|---|
| 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 |
A response() object.
r <- VERB( "PROPFIND", "http://svn.r-project.org/R/tags/", add_headers(depth = 1), verbose() ) stop_for_status(r) content(r)#> {xml_document} #> <multistatus xmlns:D="DAV:"> #> [1] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [2] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [3] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [4] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [5] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [6] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [7] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [8] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [9] <D:response xmlns:V="http://subversion.tigris.org/xmlns/dav/" xmlns:S="h ... #> [10] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [11] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [12] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [13] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [14] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [15] <D:response xmlns:V="http://subversion.tigris.org/xmlns/dav/" xmlns:S="h ... #> [16] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [17] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [18] <D:response xmlns:V="http://subversion.tigris.org/xmlns/dav/" xmlns:S="h ... #> [19] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> [20] <D:response xmlns:S="http://subversion.tigris.org/xmlns/svn/" xmlns:C="h ... #> ...VERB("POST", url = "http://httpbin.org/post")#> Response [http://httpbin.org/post] #> Date: 2020-03-11 04:09 #> Status: 200 #> Content-Type: application/json #> Size: 455 B #> { #> "args": {}, #> "data": "", #> "files": {}, #> "form": {}, #> "headers": { #> "Accept": "application/json, text/xml, application/xml, */*", #> "Accept-Encoding": "deflate, gzip", #> "Content-Length": "0", #> "Host": "httpbin.org", #> ...VERB("POST", url = "http://httpbin.org/post", body = "foobar")#> Response [http://httpbin.org/post] #> Date: 2020-03-11 04:09 #> Status: 200 #> Content-Type: application/json #> Size: 461 B #> { #> "args": {}, #> "data": "foobar", #> "files": {}, #> "form": {}, #> "headers": { #> "Accept": "application/json, text/xml, application/xml, */*", #> "Accept-Encoding": "deflate, gzip", #> "Content-Length": "6", #> "Host": "httpbin.org", #> ...