1

I'm trying to use Rack-Test to issue a post request to my padrino app:

post '/sms', "name" => "Bryan"

My route looks like this:

post :index do
  puts params.inspect
  puts rack_input.inspect
end

rack_input is a method I wrote to parse the raw rack input. When I run the test, I get this output:

{}
"name=Bryan"

However, when I use curl on the command line, it works fine:

curl -d "name=Bryan" localhost:8080/sms

{"name"=>"Bryan"}
"name=Bryan"

What am I doing wrong?

zombor
  • 3,247
  • 17
  • 30

1 Answers1

0

Try with symbols:

post '/sms', :name => "Bryan"
Macmade
  • 52,708
  • 13
  • 106
  • 123
DAddYE
  • 1,719
  • 11
  • 16