R/send_rds.R

Defines functions send_ml_results

library(httr)
library(magrittr)

send_ml_results <- function(ml_results, url = "http://0.0.0.0:7000/upload_rds") {
    temp_file <- tempfile()
    saveRDS(ml_results, temp_file)

    res <-
        POST(
            url,
            body = list(
                rds_file = upload_file(temp_file, "application/rds")
            )
        ) %>%
        content()
    return (str(res))
}
jbryer/mldash documentation built on March 4, 2023, 9:35 p.m.