且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否可以通过QNetworkAccessManager检测可恢复的链接

更新时间:2023-11-27 23:26:58

如果您想知道在开始下载之前,可以发送HEAD请求,并检查是否存在接受范围:字节"字段.标头.

If you wand to know that before starting the download, you can send a HEAD request and check if the field "Accept-Ranges: bytes" is present in the header.

QNetworkAccessManager确实包含一些代码来处理网络会话中断时的恢复操作,但不幸的是,它不是公共API的一部分.

QNetworkAccessManager does contain some code to handle resuming when the network session is interrupted, but unfortunately it is not part of the public API.