Suppose I have an endpoint like so:
get "/foo" do
request.body.rewind
data = request.body.read
# some logic goes here
end
How do I test this in Sinatra?
If I try:
it "gets /foo" do
payload = {:bar => "baz"}
get "/foo", payload
end
the payload gets sent as get parameters and not as request.body.
I am not able to change the endpoint to accept params instead of request.body at this point.