0
curl -d "params" "url"
转换为HTTParty.get要求
所以这里是我的卷发:
curl -d '[email protected]&password=mypassword' 'http://localhost:8080/locomotive/api/tokens.json'
那么,什么是httparty
等同?
curl -d "params" "url"
转换为HTTParty.get要求
所以这里是我的卷发:
curl -d '[email protected]&password=mypassword' 'http://localhost:8080/locomotive/api/tokens.json'
那么,什么是httparty
等同?
答案是:
HTTParty.post("#{my_host}/locomotive/api/tokens.json", body: {:email => "[email protected]", :password => "mypassword"})
有人要重构? –
您可以这样做:HTTParty.post(“#{my_host} /lotive/api/tokens.json”,正文:{email:“[email protected]”,密码:“mypassword”}) –