It looks like you are trying to create a REST or JSON-RPC web service using a brilliant server. This is currently not possible (using Shiny Server v1.2).
The brilliant server displays the text / html template (shinyUI) page and uses WebSocket callbacks to populate the content. The response from @ScottChamberlain will display the JSON in the body of the HTML web browser. This will not work for a web request program.
I found rApache , Rook, and RJSONIO to become a reliable and efficient solution for JSON web services. You will need to configure the Apache web server and, depending on your platform, create Apache modules.
rApache is a module that includes R in the Apache web server, allowing you to host Rook, brew, and other R-frames.
The Rook defines the interface between the R application and the web server. This makes it easy to deliver your JSON payload with the right content type.
Other options:
- OpenCPU - a dedicated R HTTP server with explicit JSON RPC support
- node-rio is a node.js server that interacts with RServe
- FastRWeb - CGI or PHP interface for connecting a web server to RServe
- RServe - TCP / IP binary R server
- httpuv - HTTP and WebSocket server library for R
- R built in rhttpd - not recommended for use in products
Jason
source share