gpt4 book ai didi

google-translate - 谷歌翻译 API : cannot send more than 2000 characters per request

转载 作者:行者123 更新时间:2023-12-02 08:38:41 25 4
gpt4 key购买 nike

Google 翻译 API 常见问题解答位于 https://developers.google.com/translate/v2/faq#technical声明每个请求的最大字符数为 5000。但是,我无法在不收到 HTTP 错误 414 的情况下发送超过 2000 个字符:请求的 URL/translate... 太大而无法处理。

我从我的 .NET 应用程序中得到这个,但也从 Fiddler 中重现了同样的错误。

下面是我发送的 URL(刚好超过 2000 个字符)。我是否误解了 5000 个字符的限制?

https://www.googleapis.com/language/translate/v2?key=MYKEY-MYKEY-MYKEY-MYKEY-MYKEY-MYKEY-KEY&source=en&target=es&q=From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0AIf%20traveling%20to%20the%20west%20From%20Sparta%3A%0D%0A

最佳答案

如果您希望处理超过 2000 个字符,则需要 POST 数据:

All other query parameters are optional. The URL for the GET, including parameters, must be less than 2K characters.

Note: You can also use POST to invoke the API if you want to send more data in a single request

https://developers.google.com/translate/v2/using_rest

关于google-translate - 谷歌翻译 API : cannot send more than 2000 characters per request,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18754905/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com