Questions tagged [plumber]

plumber is an R package used to create HTTP APIs from R. It uses annotations above your function definitions to define the structure of your API using existing R code.

The plumber R package allows R users to create HTTP APIs from their R code.

  • Official documentation - Includes documentation about the various features and online examples.
  • CRAN - The package is available on CRAN for easier installation.
307 questions
3
votes
1 answer

API that takes a file as input parameter

I’ve been asked to create an API that takes a file as input and places that file in a directory on a server. This is to take away the need for an app to interact with the folder directly. I’ve built APIs before (using Plumber in R) and can deal with…
duraq
  • 99
  • 1
  • 12
3
votes
0 answers

Asynchronous API endpoints with plumber

How do I define asynchronous API endpoints in plumber? I didn't really find plumber-specific documentation on the topic except this example and this GitHub issue When I try to reproduce the example, I get an error that R doesn't know how to turn a…
Rappster
  • 12,762
  • 7
  • 71
  • 120
3
votes
1 answer

How to display/send r plotly plots on web using plumber?

I have one plotly plot and I want to display plot on other UI such as angular, using R Plumber.
3
votes
2 answers

Problem sending POST request with big body size to Plumber API endpoint in R on Redhat 7.5

I am trying to send a table of about 140 rows and 5 columns as a JSON object (around 20 KB in size) from VBA using MSXML2.ServerXMLHTTP in a body of a POST request to an endpoint made available from R using plumber API package. The endpoint/function…
Tiger
  • 87
  • 7
3
votes
1 answer

Serve downloadable files with plumber

How can I set up my plumber API so that it serves a downloadable file? For instance I would like to pass an rds or RData object directly rather then serializing it to JSON.
jakob-r
  • 6,824
  • 3
  • 29
  • 47
3
votes
1 answer

Host multiple plumber API on shiny-server

I have shiny-server installed on my server and I want to run multiple plumber APIs from it. I have also R studio server, but with it I can run only 1 at the same time. Do you know a method to do this?
Alessio93
  • 85
  • 10
3
votes
1 answer

Serve arbitrary image files through plumber

Provided I have a saved image file, how do I serve them through plumber? For instance, this works without issues # save this as testPlumb.R library(magrittr) library(ggplot2) #* @get /test1 #* @png test1 = function(){ p = data.frame(x=1,y= 1)…
OganM
  • 2,543
  • 16
  • 33
3
votes
0 answers

R Package Plumber: Binary POST Body does not work correct

I tested to attach an STL file as body on a POST request. Configuration: Windows 10, Postman (POST->binary), R 3.4.2. The R code for the POST request looks like: #' @post /endpointname function(req) { rawstl = req$postBody # STL file is…
lambruscoAcido
  • 548
  • 4
  • 17
3
votes
1 answer

R plumber api deployment on digital ocean with swagger

I am using plumber to deploy an R api to digital ocean. It's hard to provide a reproducible example here but what I want is for the swagger endpoint to compile and be available. It works locally but not on the digital ocean server. Locally I do…
roman
  • 1,340
  • 9
  • 33
3
votes
1 answer

R: Print plot on webpage while posting data to REST API created using plumber

I have been developing a REST API using the plumber package. I am still learning the basics of how to do this. I would like the API to: 1) Received POSTed data and parameters and run a model. 2) Send back the results. 3) Print a plot on the web…
mslocum
  • 31
  • 3
3
votes
0 answers

How to run R script in Heroku?

I have created a analytics project which has three files. One is data, another is model and other is plumber run script. I am calling my model from plumber to expose my model to my Java program. Now, I need to deploy my R project to heroku or aws…
Aromadz
  • 173
  • 2
  • 13
3
votes
1 answer

R Plumber API: Prevent "504 Gateway Time-out"

I have written and deployed an R API using plumber to a Digital Ocean droplet as in the instructions. I am posting in .json data and expecting .json data back. To do this I use the curl command from the command line, for example: curl --data…
roman
  • 1,340
  • 9
  • 33
3
votes
2 answers

R API to be accessible over the web

Hi I have R code which I have converted into an API using the plumber package. library(plumber) r <- plumb("code.R") r$run(port=8000) The code sits in the file code.R and using the above lines I am able to access the API from my local machine from…
3
votes
2 answers

R plumber package for node.js parallel processing

I would like to use the plumber package to carry out some flexible parallel processing and was hoping it would work within a node.js framework such that it is non-blocking... I have the following plumber file. # myfile.R #* @get /mean normalMean <-…
h.l.m
  • 13,015
  • 22
  • 82
  • 169
2
votes
1 answer

How to implement Basic Authentication in R-plumber?

I have an API built in R-Plumber. I want to add basic authentication to this API(i.e. username and password). How can I do that?