5

I am trying to build a simple api using httpuv package. The documentation says that one could use the same Rook definition. While using the Rook package one can simple use:

req$POST()

I haven't been able to figure out how to manage simple HTTP POST requests and get their body.

Any hints?

jpmarindiaz
  • 1,599
  • 1
  • 13
  • 21

1 Answers1

6

I finally got it working. I found the answer lying somewhere in the opencpu package.

Simply read the POST body stream using:

input <- req[["rook.input"]];

postdata <- input$read_lines();

jpmarindiaz
  • 1,599
  • 1
  • 13
  • 21