在ruby中发送http post请求

时间:2016-06-06 11:50:03

标签: ruby curl

我想在ruby中发送一个http post请求:

body='{    
"request": {    
  "branch":"master"    
}}'

curl -s -X POST \

  -H "Content-Type: application/json" \
  -H "Accept: application/json" \    
  -H "Travis-API-Version: 3" \    
  -H "Authorization: token smEOuqMAAUcwLHBnFjnJkA" \

 -d "$body" \

 https://api.travis-ci.org/repo/shahsaurabh0605%2Fdaru/requests 

我该怎么做?

0 个答案:

没有答案