Google Apps脚本UrlFetchApp.fetch()截断responseText [英] Google Apps Script UrlFetchApp.fetch() truncating the responseText
问题描述
当调用UrlFetchApp.fetch()并且响应很大时(一个包含大约2000个itens并且每个项目有400个字符的json),responseText被截断。响应的长度应该是大约800.000个字符,但响应的大小是588.541个字符(大约500kb)。 urlFetch响应大小是否有限制?
感谢
href =https://developers.google.com/apps-script/guides/services/quotas =nofollow> https://developers.google.com/apps-script/guides/services/quotas ),但你应该得到分页数据。 Apps脚本不会给你足够的内存或时间来处理那么多的数据。
如果该网址不支持分页,那你的运气不好。
When calling UrlFetchApp.fetch() and the response is large (a json containing around 2000 itens with 400 characters each item), the responseText is getting truncated. The length of the response is supposed to be around 800.000 characters, but the size of the response is 588.541 characters (around 500kb). Are there any limits on urlFetch response size?
Thanks
That quota is not published (see https://developers.google.com/apps-script/guides/services/quotas) but you should get paginated data anyways. Apps script wont give you enough ram or time to process that much data. If that url doesnt suport paging you are out of luck.
这篇关于Google Apps脚本UrlFetchApp.fetch()截断responseText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!