Manage POST requests with httpuv to create a simple API with R

I am trying to create a simple api using the httpuv package. The documentation says that you can use the same definition of Rook. When using the Rook package, you can simply use:

req$POST()

I was not able to figure out how to manage simple HTTP POST messages and receive their body.

Any clues?

+4
source share
1 answer

Finally, I started to work. I found the answer lying somewhere in the opencpu package.

Just read the POST body stream using:

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

postdata <- input$read_lines();

+4
source

Source: https://habr.com/ru/post/1541342/


All Articles