无法连接到Bing转换器API
我有两个问题:无法连接到Bing转换器API,api,bing,Api,Bing,我有两个问题: 我不能用Ruby发布到MS的服务器 我无法从MS的服务器获取结果 详情如下 这是我的ruby代码:(xxxxxx是我的客户秘密) 我希望使用此代码获取我的访问令牌 但是,每次发生错误时: rescue in rbuf_fill': Timeout::Error (Timeout::Error) 因此,我使用bash命令curl进行post,并返回一个响应: {"token_type":"http://schemas.xmlsoap.org/ws/2009/11/swt-toke
rescue in rbuf_fill': Timeout::Error (Timeout::Error)
因此,我使用bash命令curl进行post,并返回一个响应:
{"token_type":"http://schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0","access_token":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","expires_in":"599","scope":"http://api.microsofttranslator.com"}
然后,我想用我的访问令牌将一个英文单词翻译成中文,但还是失败了。以下是我的代码:
#!/bin/bash
clear
curl -H "Authorization: Bearer xxxxx" -d "appId&text=apple&to=zh-CHS&from=en&maxTranslations=10" http://api.microsofttranslator.com/V2/Http.svc/GetTranslations
其中,xxxxx是直接从上面的访问令牌复制的,类似于“http%3a%2f%2f”的内容
根据。我认为没有什么问题
然而,我只得到
Error Status Code: 'InternalServerError'
Details: The server encountered an error processing the request. Please see the server logs for more details.
谁能告诉我问题出在哪里?尝试重新排序参数——我发现在“from”之前必须先“to” 还可以尝试去掉“maxtransations”参数
Error Status Code: 'InternalServerError'
Details: The server encountered an error processing the request. Please see the server logs for more details.