I've seen a number of people ask various versions of this question but I haven't found a clear answer.
I would like to send a POST request to an R Shiny application so that after the request is received the Shiny app can render the data from the body of the request. For instance, consider the use case where I wrote some sort of special analyzeData(data)
R function that someone would run locally on their laptop. Within that function would be a httr::POST
request that would upload the data to the Shiny server, and then the user would have the browser pop open and see the UI showing their data analyzed on the server. In a sense it's kind of like a fancy version of an "upload data" button, but instead of them uploading data from within the Shiny UI they instead would have the upload done before the UI opens by the function request.
So the flow would be:
- User runs
analyzeData(data)
function - That function does a POST request to the Shiny server to send the data
- The browser pops open for that user so they can see the results from Shiny analyzing it.
So far as I can tell Shiny can't accept a POST request in this fashion. In fact I'm not sure there is any way for Shiny to accept data besides through a UI. It's almost like I want to have both Plumber and Shiny running on the same machine (Plumber to accept the data POST request, Shiny to then render the resulting UI), but that feels like overengineering.
Am I missing something? Is there a way to have this flow work with Shiny accepting the POST request directly?