gpt4 book ai didi

http - CURL 从无限管道分块 POST?

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:22:29 24 4
gpt4 key购买 nike

我想连续向网络服务器发送无限二进制数据流。所以我正在使用以下命令:

curl -X POST -H "Transfer-Encoding: chunked" -d 'hello' http://127.0.0.1:9000 

作为测试,我将输出“yes”命令:

$ yes | curl -X POST -H "Transfer-Encoding: chunked" -d '@-' http://127.0.0.1:9000

但它甚至没有连接到网络服务器,并因内存不足错误而中止。似乎 curl 正在尝试在开始传输之前将整个文件读入内存。

curl 是否支持来自管道的连续 HTTP 发布数据? (我使用的是 curl 版本 7.61.0)。

谢谢!

最佳答案

试试

yes | curl -T. http://127.0.0.1:9000

但是你可能会遇到这个已知的错误:

或者

yes | curl -T- http://127.0.0.1:9000

关于http - CURL 从无限管道分块 POST?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52661843/

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