Advertisement
Guest User

Untitled

a guest
May 14th, 2013
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. require 'net/http'
  2. require 'json'
  3. # require 'debugger'
  4. # require 'uri'
  5. # require 'httparty'
  6.  
  7.  
  8. x = {:client_id => "",
  9. :client_secret => "",
  10. :scope => "http://api.microsofttranslator.com",
  11. :grant_type => "client_credentials" }
  12.  
  13. auth_uri = URI "https://datamarket.accesscontrol.windows.net/v2/OAuth2-13"
  14.  
  15. # y = "https://datamarket.accesscontrol.windows.net/v2/OAuth2-13/"
  16.  
  17. # z = HTTParty.post(y,x)
  18.  
  19. z = Net::HTTP.post_form auth_uri,x
  20. # p JSON.parse(z.body)
  21. # debugger
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement