tests/testthat/helper-server.R

# On posix all requests mus be done from an extra session
# otherwise the main session will deadlock.
fetch_get <- function(...) {
    if (.Platform$OS.type == "windows") {
        return(
            httr::GET(...)
        )
    } else {
        return(
            (function() {
                future::plan("multisession")
                v <- future::value(future::future({
                    return(httr::GET(...))
                }))
                future::plan("sequential")
                v
            })()
        )
    }
  }

Try the httpgd package in your browser

Any scripts or data that you put into this service are public.

httpgd documentation built on June 22, 2024, 10:26 a.m.