getURLcheckStatus | R Documentation |
This is a wrapper for getURL that throws an error when the HTTP status is 400 or greater, or possibly when the response is html.
getURLcheckStatus(url, ..., requireJSON = FALSE)
postURLcheckStatus(url, postfields, ..., requireJSON = FALSE)
putURLcheckStatus(url, postfields, ..., requireJSON = FALSE)
deleteURLcheckStatus(url, ..., requireJSON = FALSE)
url |
the url to get/post |
... |
optional parameters passed to getURL |
requireJSON |
boolean if errors should be thrown on JSON |
postfields |
data sent to the server |
Checks the HTTP status and logs to racas.log as com.acas.sel if 400
or greater. Setting requireJSON to TRUE
will add a check for if the
response is HTML (but not necessarily valid JSON). POST, PUT, and DELETE can
be done with their own functions. In POST and PUT, the postfields
will also be logged. Within racas
, postfields
is usually JSON.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.