是否可以通过QNetworkAccessManager检测可恢复的链接 [英] Is it possible to detect the resume-able links via QNetworkAccessManager

查看:100
本文介绍了是否可以通过QNetworkAccessManager检测可恢复的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我希望暂停下载,然后重新开始.我们能否事先知道链接是否可以恢复.我的意思是此信息可与标题一起使用.

Suppose i wish to pause the download, and start it again. Can we know before hand whether the link is resume-able. I mean is this info available with the headers.

推荐答案

如果您想知道在开始下载之前,可以发送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.

这篇关于是否可以通过QNetworkAccessManager检测可恢复的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆