0

I noticed some strange behaviour of mcapply in combination with httr. Namely, When using lapply, everything works fine. That is I iteratre through some ids and create httr::GET statements to my server.

ret <- lapply(ids, FUN = make_call)
make_call <- function(id) {
 httr::GET...
}

However, when changing to ret <- parallel::mclapply(ids, FUN = make_call), I get:

[[1]]
[1] "Error in curl::curl_fetch_memory(url, handle = handle) : \n  Illegal or missing hexadecimal sequence in chunked-encoding\n"
attr(,"class")
[1] "try-error"
attr(,"condition")
<simpleError in curl::curl_fetch_memory(url, handle = handle): Illegal or missing hexadecimal sequence in chunked-encoding>

[[2]]
[1] "Error in curl::curl_fetch_memory(url, handle = handle) : \n  Received HTTP/0.9 when not allowed\n"
attr(,"class")
[1] "try-error"
attr(,"condition")
<simpleError in curl::curl_fetch_memory(url, handle = handle): Received HTTP/0.9 when not allowed>

Any ideas what's going on here?

Ai4l2s
  • 525
  • 2
  • 9
  • These errors look specific to the server you are accessing. Without any sort of [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) it will be difficult to help. Are you going through the exact same list of IDs with the `lapply` and `mclapply`? – MrFlick Nov 22 '22 at 21:33

0 Answers0