forked from zlu/tropo-webapi-ruby
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add answer to TROPO JSON helper library with support for RPID parameters - WebAPI Ruby
- Loading branch information
1 parent
a052df8
commit 5529274
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require 'lib/tropo-webapi-ruby' | ||
|
||
require 'sinatra' | ||
|
||
set :bind => "192.168.26.1" | ||
set :port => "12457" | ||
|
||
|
||
post '/index.json' do | ||
|
||
t = Tropo::Generator.new | ||
|
||
t.answer :headers => {:keey1 => "gffdddddddddddddd", | ||
:keey2 => "value 2 here"} | ||
|
||
t.say :value => "i am answer method say content", | ||
:name => "justaname" | ||
|
||
headers \ | ||
"WebAPI-Lang-Ver" => "ruby-frank20170824", | ||
"rubyversion" => "ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]" | ||
|
||
"This is t.response, where is t.response" | ||
t.response # def response line 464 | ||
|
||
end | ||
|
||
|
||
post '/continue.json' do | ||
|
||
v = Tropo::Generator.parse request.env["rack.input"].read | ||
t = Tropo::Generator.new | ||
#pppppppquts v | ||
userType = v[:result][:user_type] | ||
#pppppppquts userType | ||
t.say(:value => "You are a #{userType}") | ||
|
||
t.response | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters