Following the tutorial for Twilio Client. Got stuck here where you do the testing https://www.twilio.com/docs/quickstart/ruby/client/incoming-calls
curl -X POST http://localhost:3000/voice
I keep getting the WEBrick::HTTPStatus::LengthRequired response.
When I put it as
curl -X POST http://localhost:3000/voice -d ''
It works. But how do I fix for this in my routes or controller?
routes.rb
post 'voice', to: 'calls#voice', as: :voice
controller
def voice
response = Twilio::TwiML::Response.new do |r|
# Should be your Twilio Number or a verified Caller ID
r.Dial :callerId => '+16479316790' do |d|
d.Client 'jenny'
end
end
render :text => response.text
end
Thanks! Also, if you have done this previously... having trouble adding localhost:3000 as the callback url in the dashboard. Any suggestions?