Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No suitable parser found to handle request body type application/vnd.ms-excel. #959

Open
chuxinyuan opened this issue Jul 10, 2024 · 0 comments

Comments

@chuxinyuan
Copy link

chuxinyuan commented Jul 10, 2024

Description

I want to upload the data in .csv format, but I had trouble deploying it to the server.

Code

plumber_run.R

library(plumber)
pr("plumber.R") %>%
  pr_run(host = "0.0.0.0", port = 8001)

plumber.R

#* @apiTitle  render report API

#* upload csv file
#* @post /upload
#* @parser multi
#* @parser csv
#* @param f:file
\(f) {
  data = read.csv(f[[1]])
  print(data)
}

Data

data = data.frame(
  name = c("AAA", "BBB", "CCC"),
  ID = c("001", "002", "003"),
  address = c("Peking", "New York", "Paris")
)
write.csv(data, "data.csv", row.names = FALSE)

Session info

R version 4.2.2 Patched (2022-11-10 r83330)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 12 (bookworm), RStudio 2022.7.1.554

Locale:
  LC_CTYPE=zh_CN.UTF-8       LC_NUMERIC=C               LC_TIME=zh_CN.UTF-8       
  LC_COLLATE=zh_CN.UTF-8     LC_MONETARY=zh_CN.UTF-8    LC_MESSAGES=en_US.UTF-8   
  LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
  LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

Package version:
  askpass_1.2.0     base64enc_0.1.3   bslib_0.7.0       cachem_1.1.0      cli_3.6.2        
  compiler_4.2.2    crayon_1.5.2      curl_5.2.1        data.table_1.15.4 digest_0.6.35    
  ellipsis_0.3.2    evaluate_0.23     fansi_1.0.6       fastmap_1.2.0     fontawesome_0.5.2
  fs_1.6.4          glue_1.7.0        graphics_4.2.2    grDevices_4.2.2   highr_0.11       
  htmltools_0.5.8.1 httpuv_1.6.15     httr_1.4.7        jquerylib_0.1.4   jsonlite_1.8.8   
  knitr_1.47        later_1.3.2       lifecycle_1.0.4   magrittr_2.0.3    memoise_2.0.1    
  methods_4.2.2     mime_0.12         openssl_2.2.0     pillar_1.9.0      pkgconfig_2.0.3  
  plumber_1.2.2     promises_1.3.0    purrr_1.0.2       R6_2.5.1          rapidoc_9.3.4    
  rappdirs_0.3.3    Rcpp_1.0.12       rlang_1.1.3       rmarkdown_2.27    rstudioapi_0.16.0
  sass_0.4.9        sodium_1.3.1      stats_4.2.2       stringi_1.8.4     swagger_5.17.14.1
  sys_3.4.2         tibble_3.2.1      tinytex_0.51      tools_4.2.2       utf8_1.2.4       
  utils_4.2.2       vctrs_0.6.5       webutils_1.2.0    xfun_0.44         yaml_2.3.8  
@chuxinyuan chuxinyuan changed the title How do I proceed after the csv file is uploaded No suitable parser found to handle request body type application/vnd.ms-excel. Jul 10, 2024
@chuxinyuan chuxinyuan changed the title No suitable parser found to handle request body type application/vnd.ms-excel. An error occurred while rendering the document on the server "error": "500 - Internal server error Jul 11, 2024
@chuxinyuan chuxinyuan changed the title An error occurred while rendering the document on the server "error": "500 - Internal server error No suitable parser found to handle request body type application/vnd.ms-excel. Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant