Occasionally get "attempt to apply non-function" error when applying getForm

api, r

Solution

It's just a download error, sometimes the download fails. I just put in a provision to try the download again in that case.

Problem

I'm using getForm to repeatedly pull data from an api. Sometimes the program finishes, and other times after some amount of iterations, I get the following error message: ``` Error in curlPerform(url = url, curl = curl, .opts = .opts) : attempt to apply non-function In addition: There were more than 50 warnings (use warnings() to see the first 50) > traceback() 5: .Call("R_curl_easy_perform", curl, .opts, isProtected, .encoding, PACKAGE = "RCurl") 4: curlPerform(url = url, curl = curl, .opts = .opts) 3: getURLContent(uri, .opts = .opts, .encoding = .encoding, binary = binary, curl = curl) 2: getForm("https://xx", .params = parval) 1: fromJSON(getForm("https://xx", .params = parval)) at #32 ``` the warnings are: ``` In RCurlIconv(str, from = "C99", to = encoding) : UTF-8 not supported iconv entries ``` Thanks for your help!

Original source