[why] when send requise use rest-client, request data is not supportted for get, so we need to change it to post.
Signed-off-by: Luan Shengde shdluan@163.com --- container/assign-account/assign-account.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/container/assign-account/assign-account.rb b/container/assign-account/assign-account.rb index 4ed95c0..c5d77db 100755 --- a/container/assign-account/assign-account.rb +++ b/container/assign-account/assign-account.rb @@ -12,9 +12,9 @@ require_relative 'get_account_info' set :bind, '0.0.0.0' set :port, 29999
-get '/assign_account' do +post '/assign_account' do begin - data = YAML.safe_load request.body.read + data = JSON.parse request.body.read rescue StandardError => e puts e.message puts e.backtrace
On Sat, Dec 26, 2020 at 05:07:35PM +0800, Luan Shengde wrote:
[why] when send requise use rest-client, request data is not supportted for
What's the requise?
supportted => supported.
get, so we need to change it to post.
The get method can send the data, you can just say change get to post.
Thanks, Xueliang
Signed-off-by: Luan Shengde shdluan@163.com
container/assign-account/assign-account.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/container/assign-account/assign-account.rb b/container/assign-account/assign-account.rb index 4ed95c0..c5d77db 100755 --- a/container/assign-account/assign-account.rb +++ b/container/assign-account/assign-account.rb @@ -12,9 +12,9 @@ require_relative 'get_account_info' set :bind, '0.0.0.0' set :port, 29999
-get '/assign_account' do +post '/assign_account' do begin
- data = YAML.safe_load request.body.read
- data = JSON.parse request.body.read rescue StandardError => e puts e.message puts e.backtrace
-- 2.23.0
On Mon, Dec 28, 2020 at 03:04:54PM +0800, Cao Xueliang wrote:
On Sat, Dec 26, 2020 at 05:07:35PM +0800, Luan Shengde wrote:
[why] when send requise use rest-client, request data is not supportted for
What's the requise?
supportted => supported.
get, so we need to change it to post.
The get method can send the data, you can just say change get to post.
ok, I have done it
Thanks, Luan Shengde
Thanks, Xueliang
Signed-off-by: Luan Shengde shdluan@163.com
container/assign-account/assign-account.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/container/assign-account/assign-account.rb b/container/assign-account/assign-account.rb index 4ed95c0..c5d77db 100755 --- a/container/assign-account/assign-account.rb +++ b/container/assign-account/assign-account.rb @@ -12,9 +12,9 @@ require_relative 'get_account_info' set :bind, '0.0.0.0' set :port, 29999
-get '/assign_account' do +post '/assign_account' do begin
- data = YAML.safe_load request.body.read
- data = JSON.parse request.body.read rescue StandardError => e puts e.message puts e.backtrace
-- 2.23.0