我正在使用.NET庫http://code.google.com/p/google-api-dotnet-client/wiki/APIs#Translate_API翻譯文本,但我無法翻譯大文本,只是一小部分。Google翻譯如何翻譯大文本((414)請求 - URI太大)與.NET庫
我收到錯誤(414)請求URI太大。應該有一些方法如何做到這一點。
我有這樣的代碼
var service = new TranslateService();
service.Key = this.ApiKey;
var request = service.Translations.List(textToTranslate, this.LngDestination);
request.Source = this.LngSource;
TranslationsListResponse response = request.Fetch();
foreach (TranslationsResource translation in response.Translations)
{
return translation.TranslatedText;
}
有人不知道如何解決這個問題呢?
如果請求URI太大,則表示執行了GET請求。 POST請求將傳輸文本以在消息負載中進行翻譯,而不是在請求URI中進行翻譯。檢查您是否可以用某種方式配置您使用的庫,而不是使用POST。 – dtb 2013-02-20 22:05:08