gpt4 book ai didi

javascript - 如何在 Google Cloud Functions 中获取 HTTP 请求正文大小?

转载 作者:行者123 更新时间:2023-12-01 00:07:45 25 4
gpt4 key购买 nike

我想检索请求正文的大小以过滤掉大型 HTTP post 请求。那么,如何获取请求的长度?

最佳答案

根据其文档,Cloud Functions 对 HTTP 请求和响应负载的硬性限制为 10 MB。更多详情可以查看documentation 。而且,你也不能延长限制(我还没有找到)。

为了检查请求的长度,您可以使用 req.get("content-length")

关于javascript - 如何在 Google Cloud Functions 中获取 HTTP 请求正文大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60261800/

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