Questions tagged [restrserve]

mark questions related to RestRserve usage (https://restrserve.org)

11 questions
2
votes
1 answer

XLSX data upload with RestRserve

I would like to work with RestRServe to have a .xlsx file uploaded for processing. I have tried the below using a .csv with success, but some slight modifications for .xlsx with get_file was not fruitful. ps <- r_bg(function(){ …
kquach
  • 161
  • 1
  • 10
2
votes
1 answer

Multipart/form-data with RestRserve

I would like to expose an endpoint that accepts multipart/form-data, parses the multipart content and returns a csv-file. (the multipart input contains a csv dataset and processing instructions) I’ve done this with plumber using…
Rok
  • 97
  • 6
0
votes
0 answers

forwarding/proxying a request using RestRserve

Suppose I have the following setup, which has two apps running on different ports using the RestRserve (these might e.g. be on different servers, both of which I control). I would like requests to :8081/health to be forwarded to :8080/health exactly…
richarddmorey
  • 976
  • 6
  • 19
0
votes
1 answer

cannot access RestRserve via GET on localhost from a browser

I am starting a RestRserve application using the following R code (MacOS): library(RestRserve) app = Application$new( middleware = list(CORSMiddleware$new()) ) app$add_static( path = '/main', file_path =…
richarddmorey
  • 976
  • 6
  • 19
0
votes
1 answer

R RestRserve Add Etag to static path

Let's say I have a REST API using RestRserve like this, is there a way to add an Etag to enable caching on cloud services? writeLines("Hello World", "myfile.txt") app <- Application$new(content_type = "application/json") app$add_static("/",…
David
  • 9,216
  • 4
  • 45
  • 78
0
votes
1 answer

Logging errors with restrserve

I am currently creating a REST API with restrserve. While trying to add a logger to my application I ran into this problem. By setting the log level as: application$logger$set_log_level("error"), my console output on error has a JSON structure…
sossaman
  • 3
  • 2
0
votes
1 answer

How to extract parameters from path in RestRserve?

This is the code for an app # load_libraries ---------------------------- library("RestRserve") # func_UserId ---------------------------- get_userid <- function(req, res) { id = req$get_param_path("id") res$set_body(id) } # create app…
Vikram
  • 157
  • 1
  • 12
0
votes
2 answers

Cannot deveolop API using RestRserve on remote server

Condider that I've built my application as in te example below: library(RestRserve) app = Application$new() app$add_get( path = "/hello", FUN = function(request, response) { response$set_body("Hello from RestRserve") }) backend =…
Fabio
  • 518
  • 1
  • 4
  • 10
0
votes
0 answers

Return multipart body with RestRserve?

Can RestRserve return multiple files via multipart/form-data? I've tried using set_body(c("file"=path)) and it returns the file content as per documentation. This doesn't work with several files, however, as a list of filenames will be returned and…
Rok
  • 97
  • 6
0
votes
1 answer

Logging each request to a separate json file with RestRserve

How would one set up logging each request to a different json file with RestRserve? I tried using the lgr package (referred to in RestRserve's doc on logging) like so: library(RestRserve) library(lgr) app = Application$new(content_type =…
Rok
  • 97
  • 6
0
votes
1 answer

How to reach a restrserve api from rstudio server on aws?

I am trying out the very interesting package RestRserve from with RStudo server that I installed on an AWS instance. This is de code I use: library(RestRserve) app = Application$new() app$add_get( path = "/hello", FUN = function(request,…
rdatasculptor
  • 8,112
  • 14
  • 56
  • 81