I have a Sinatra app where I want to get client input, as demonstrated in the following pseudo-code:
get '/foo' do
"doing some stuff"
foo = getInputFromClient
foo
"continuing to do more stuff"
foo = getInputFromClient
foo
"done"
end
This is the output that I would like to see at the client end:
curl http://127.0.0.1:4567/foo #start the request
doing some stuff
#Somehow submit "shoop" to Sinatra
shoop
continuing to do more stuff
#Somehow submit "woop" to Sinatra
woop
done
I can't split this up into two curl calls. How do I accomplish this? Should I not be using Sinatra in the first place? Do I have to switch to sockets?
I have read these other questions which do seem related, I'm not familiar enough with what they're talking about to see if it applies to me or not. A simplification of the other questions to my case or a few keywords to Google would be appreciated.