小编use*_*563的帖子

错误:发送 base64 post 请求时请求正文大于 maxBodyLength 限制 Axios

当发送带有 Base64 编码的 pdf 作为正文的 post 请求时,我收到错误

错误:请求正文大于 maxBodyLength 限制

我试过设置以下两个

“maxContentLength”:无限,“maxBodyLength”:无限

在请求配置中

const result = await axios({
            url: `the url`,
            headers: {'Authorization': `Bearer ${auth_token}`, 'Content-Type': 'application/json'},
            method: 'post',
            data: {
                'ParentId': record_id,
                'Name': file_name,
                'body': body,
                'Description': description ? description : "",
                'maxContentLength': Infinity,
                'maxBodyLength': Infinity
            }
        });
Run Code Online (Sandbox Code Playgroud)

有没有人有解决方法?

node.js axios

21
推荐指数
2
解决办法
2万
查看次数

嵌套函数定义

我只是在通过 Programming Elixir 和 implpementing Split 工作。

我的代码如下 -

defmodule MyEnum do
    def split(l, n) do
        def split_helper([], pre, _n), do: {pre, []}
        def split_helper(l, pre, 0), do: {pre, l}
        def split_helper([h|t], pre, n), do: split_helper(t, [h|pre], n-1)
        split_helper(l, [], n)
    end
end
Run Code Online (Sandbox Code Playgroud)

我收到错误 - 无法在函数/宏中调用 def/2

我的意思是我不能嵌套命名函数。由于您不能编写递归匿名函数并且没有letrec,我想知道如何在嵌套函数递归的地方嵌套函数。这是我在球拍中构建代码的方式,因为我永远不需要在其他任何地方使用 split_helper。

elixir

1
推荐指数
1
解决办法
583
查看次数

标签 统计

axios ×1

elixir ×1

node.js ×1