谈谈QNetworkAccessManager
谁能给讲讲QNetworkAccessManager、QNetworkReply、QNetworkRequest这三个类的关系,他们是如何关联的,在网络传输过程中,post和get又该设置什么?
[解决办法]
跟get方法一样,统一用QNetworkReply接收返回数据
[解决办法]
The QNetworkAccessManager class allows the application to send network requests and receive replies
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager
The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
上面是官方的说明,说得很清楚了。
QNetworkReply 负责发送,QNetworkReply 是发送后的接受
QNetworkAccessManager 的这个 函数就把三个都包括了,并且很清楚的表明了三者的关系
QNetworkReply *post ( const QNetworkRequest & request, const QByteArray & data )