我在我的模型方法中有我从我的控制器调用以下代码。如何通过jruby代码停止curl命令的执行?
Kernel.system"curl -H "Content-Type:application/json" -d "{\"party\":{\"lock_version\":\"0\",\"party_type\":\"Customer\",\"name\":\"xxxxx\",\"sub_type\":\"\",\"description\":\"\",\"contacts_attributes\":{\"1\":{\"name\":\"Jy\",\"email\":\"[email protected]\",\"is_default\":\"true\",\"_destroy\":\"0\"}}}}" "http://localhost:3000/company/customers?auth_token=BhD7P6sXkHkNwVVXx3TF""
,在控制台上我可以看到。
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 202 0 0 0 202 0 0 --:--:-- 0:04:13 --:--:-- 0
但上述过程是保持on.When关闭我的服务器使用CTRL+c
我可以看到我的控制台上以下行去。
Started POST "/company/customers?auth_token=BhD7P6sXkHkNwVVXx3TF" for 127.0.0.1 at Mon Nov 26 05:24:13 +0000 2012 Processing by PartiesController#create as JSON Parameters: {"party"=>{"lock_version"=>"0", "party_type"=>"Customer", "name"=>"xxxxx", "sub_type"=>"", "description"=>"", "contacts_attributes"=>{"1"=>{"name"=>"Jy", "email"=>"[email protected]", "is_default"=>"true", "_destroy"=>"0"}}}, "auth_token"=>"BhD7P6sXkHkNwVVXx3TF", "party_type"=>"Customer"} WARNING: Can't verify CSRF token authenticity
这意味着,我的customer
成功使用curl
。
但为什么我需要关闭我的服务器,然后重新启动inorder看到curl
命令的结果?有没有解决这个问题的方法,或者我做错了什么?
请帮我,
谢谢。