use rest-client instead of linux command 'curl' to send http request
Signed-off-by: Luan Shengde shdluan@163.com --- container/mail-robot/lib/apply-jumper-account.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/container/mail-robot/lib/apply-jumper-account.rb b/container/mail-robot/lib/apply-jumper-account.rb index 44f412b..73d2946 100755 --- a/container/mail-robot/lib/apply-jumper-account.rb +++ b/container/mail-robot/lib/apply-jumper-account.rb @@ -22,8 +22,8 @@ class ApplyJumperAccount end
def apply_jumper_account - account_info_str = %x(curl -XGET "#{@jumper_host}:#{@jumper_port}/assign_account" \ - -d '#{@my_info.to_json}') + assign_account_url = "#{JUMPER_HOST}:#{JUMPER_PORT}/assign_account" + account_info_str = RestClient.post assign_account_url, @my_info.to_json account_info = JSON.parse account_info_str
account_info_exist(account_info)