Skip to content

Instantly share code, notes, and snippets.

@kwhinnery
Created September 17, 2014 19:35
Show Gist options
  • Save kwhinnery/cff076791170fc9ba175 to your computer and use it in GitHub Desktop.
Save kwhinnery/cff076791170fc9ba175 to your computer and use it in GitHub Desktop.
# create a route that will respond to an incoming POST request from Twilio
post '/message' do
# Create a TwiML response object - this object helps us generate an XML string
# that we will return as the result of this request
twiml = Twilio::TwiML::Response.new do |r|
r.Message do |m|
m.Body 'Trust Pound!'
m.Media 'http://i.imgur.com/Act0Q.gif'
end
end
# set the Content-Type header of the response for XML
content_type 'text/xml'
twiml.text
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment