문제

I'm using Google Translation API to translate text from Chinese Simplified to English in my C# program. The problem is if the text is small (around one line) the API is able to translate it, but if the text is larger (more than 3 lines) is gives an exception saying "The remote server returned an unexpected response: (414) Request-URI Too Large.". However if I use translate.google.com in my browser that works fine.

Please tell me how can I process large documents using Google Translate API in my desktop application written in C#.

도움이 되었습니까?

해결책

I don't speak C#, but my guess is you are using GET as the method to transport the text. GET parameters have a limited maximum size (usually around 1 or 2 kilobytes). I think you need to use POST.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top