I want to use the Microsoft Translate API and I am already stuck obtaining the access token.
This is how my code looks like:
authUri = "https://datamarket.accesscontrol.windows.net/v2/OAuth2-13/"
paramHash = {
"client_id" => "test",
"client_secret" => "*****",
"scope" => "http://api.microsofttranslator.com",
"grant_type" => "client_credentials"
}
postData = Net::HTTP.post_form(URI.parse(authUri), paramHash)
puts postData.body
But this won't terminate and after a while I get a Timeout Error:
`rescue in rbuf_fill': Timeout::Error (Timeout::Error)
I already tried the a Rest-Client gem and curl. Both worked perfectly fine, but I don't like incorporating another gem for such a simple task.
When I send the post request to localhost and listen with netcat I see the exact same requests (except for User-Agent, but even changing that didn't solve the problem)