Google Apps脚本UrlFetchApp.fetch()截断responseText [英] Google Apps Script UrlFetchApp.fetch() truncating the responseText

查看:175
本文介绍了Google Apps脚本UrlFetchApp.fetch()截断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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆