Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. url = 'http://someurl'
  2. request = {"data" => data}.to_json
  3. response = RestClient.post(url,request,:content_type => :json, :accept => :json)
  4.  
  5. curl -XHEAD -H x-auth-user: myusername -H x-auth-key: mykey "url"
  6.  
  7. response = RestClient.post(
  8. url,
  9. request,
  10. :content_type => :json, :accept => :json, :'x-auth-key' => "mykey")
  11.  
  12. RestClient::Request.execute(
  13. :method => :get or :post,
  14. :url => your_url,
  15. :headers => {key => value}
  16. )
  17.  
  18. params = {id: id, device: device, status: status}
  19. headers = {myheader: "giorgio"}
  20.  
  21. RestClient.put url, params, headers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement