Execute a Call to the REDCap API
apiCall is a wrapper for attempting to access the
httr::POST, and then via
RCurl::postForm if a
particular error occurs. This prevents a particular kind of error for
which I haven't found a proper solution, but at least allows the
expected behavior of the package. Since writing this, I have found
a solution to set the config option
may remove this function at some point in the future.
URL of the REDCap API
List of parameters to be passed to
A list of options to be passed to
Somewhere in the middle of an upgrade to RStudio, R 3.1.1, and
various other system changes, I began seeing the error
'GnuTLS recv error (-9): A TLS packet with unexpected length was received.'
I still don't know what this error means, but it only occurs when using
httr on Linux. The
RCurl equivalents appear to work just fine.
In order to prevent this error from occurring, and making the package
httr::POST into a
tryCatch call. If the GnuTLS error is thrown,
then resorts to using the
RCurl equivalent call.
Since originally writing this function, I've determined that the problem
occurs due to weird characters being exported from REDCap that cannot be
properly escaped in R. It can be resolved by using the config option
encoding = 'identity'. Making this a default could make this
Please refer to your institution's API documentation.
Additional details on API parameters are found on the package wiki at https://github.com/nutterb/redcapAPI/wiki/REDCap-API-Parameters
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.