gpt4 book ai didi

erlang - 使用 httpc lib 将大型 http 响应流式传输到 Erlang 中的磁盘

转载 作者:行者123 更新时间:2023-12-04 04:12:58 24 4
gpt4 key购买 nike

httpc:request(get, {URL, []}, [], [{stream, FilePath}]) 返回 {ok, saved_to_file} 即使远程 Web 服务在流式传输响应时中途终止。我检查了磁盘上的内容丢失了一大堆数据。这是一个已知的怪癖吗?

最佳答案

我提交了一份 bug-report OTP 团队的回答表明这是一个错误(至少对于当前的 HTTP 规范而言):

I think this is due to that the client has backwards compatibility with servers that would close the connection to indicate that all data has been sent. Probably this should be made conditional for only old versions of the HTTP protocol or maybe it could be dropped... - Ingela Anderton Andin

关于erlang - 使用 httpc lib 将大型 http 响应流式传输到 Erlang 中的磁盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61393065/

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