qnetworkaccessmanager

QT HTTP Post issue when server requires cookies

依然范特西╮ 提交于 2020-01-01 09:55:13
问题 I have been trying this whole day with no success. Please help in solving the issue. On googling I found many users had this issue but nowhere I could find a solution. I am trying to do HTTP post in QT C++ & I have already tried doing that in python (My question is not a python question, so Qt pros please help ).. I know, I am somewhere wrong in handling cookies and all, so please help. Please provide probable solutions. In python, code is clean and simple. I have stripped error handling and

How to read data from QNetworkReply being used by QWebPage?

随声附和 提交于 2019-12-28 13:56:09
问题 I use QWebPage to download a webpage as well as all its resources. At the same time I'd like to get hold on raw data being downloaded by Qt during this process. Doing this by reading data from QNetworkReply in void QNetworkAccessManager::finished(QNetworkReply * reply) signal is not a good solution as data could have been already read by QWebPage itself. This is because QNetworkReply is a sequential-access QIODevice, which means that once data is read from the object, it no longer kept by the

Disable Qt bearer management at runtime

牧云@^-^@ 提交于 2019-12-24 00:18:49
问题 We have some problems with the Qt network bearer management (Win10 x64, Qt 5.9.latest). The following problems are noticed: a WIFI interface is not recognized a WIFI interface is marked as inaccessible though working (QAM requests work) cable LAN is not affected To some extend I simply can fix the issue by deleting the bearer folder from my distribution. I understand I can compile a Qt version without bearer management, but this is a precompiled Win64 version with just a deleted bearer folder

QNetworkAccessManager sends GET two times

筅森魡賤 提交于 2019-12-23 21:37:31
问题 I've got some class to interfere with HTTP-server. Here is meaningfull code parts: const QString someClass::BASEURL = QString("http://127.0.0.1:8000/?"); someClass::someClass(): manager(new QNetworkAccessManager(this)) { } QNetworkReply *someClass::run(QString request) { qDebug() << request; QEventLoop loop; QObject::connect(manager, SIGNAL(finished(QNetworkReply*)), &loop, SLOT(quit())); QNetworkReply *res = manager->get(QNetworkRequest(QUrl(BASEURL + request))); loop.exec(); return res; }

PyQt: how to use QWebPage with an anonimous proxy

旧时模样 提交于 2019-12-23 12:16:56
问题 This is driving me crazy. I want to show in a QWebPage an url, but i want to do it passing by an anonimous proxy. Code #setting up the proxy proxy = QNetworkProxy() proxy.setHostName("189.75.98.199") #just examples proxy.setPort(1111) proxy.setType = QNetworkProxy.HttpProxy #setting the manager manager = QNetworkAccessManager() manager.setProxy(proxy) #setting the proxy on the manager #setting the proxy as application proxy QNetworkProxy.setApplicationProxy(proxy) #seems to do nothing.. #web

Qt Jambi: Accessing the content of QNetworkReply

陌路散爱 提交于 2019-12-23 02:56:06
问题 I'm having trouble accessing the content of QNetworkReply objects. Content appears to be empty or zero. According to the docs (translating from c++ to java) I think I've got this set up correctly, but to no avail. Additionally an "Unknown error" is being reported. Any ideas much appreciated. Code: public class Test extends QObject { private QWebPage page; public Test() { page = new QWebPage(); QNetworkAccessManager nac = new QNetworkAccessManager(); nac.finished.connect(this, "requestFinished

Qt: connect a signal after a request is sent in QNetworkAccessManager [duplicate]

风格不统一 提交于 2019-12-22 14:54:46
问题 This question already has an answer here : Qt signal slot connection - QNetworkAccessManager (1 answer) Closed 4 years ago . I was checking some simple examples of using QNetworkAccessManager and I found this (Assuming that manager is a QNetworkAccessManager: QNetworkRequest request; request.setUrl(QUrl("http://www.someserver.com")); QNetworkReply *reply = manager->get(request); connect(reply, SIGNAL(readyRead()), this, SLOT(slotReadyRead())); connect(reply, SIGNAL(error(QNetworkReply:

QNetworkAccessManager upload to local FTP server

不打扰是莪最后的温柔 提交于 2019-12-22 12:24:58
问题 I can download from the server but I can't upload to it. It uploads the file but it's an empty file. This is basically what I'm doing: QString filename="Data.txt"; QFile file( filename ); file.open(QIODevice::ReadWrite); file.write("HELLO") ; QUrl urlup("ftp://127.0.0.1/file.txt"); urlup.setPassword("123"); urlup.setUserName("user"); urlup.setPort(21); QNetworkAccessManager *nam = new QNetworkAccessManager; QNetworkRequest requp(urlup); nam->put(requp,&file); file.close(); but it's not

QNetworkAccessManager upload to local FTP server

女生的网名这么多〃 提交于 2019-12-22 12:23:58
问题 I can download from the server but I can't upload to it. It uploads the file but it's an empty file. This is basically what I'm doing: QString filename="Data.txt"; QFile file( filename ); file.open(QIODevice::ReadWrite); file.write("HELLO") ; QUrl urlup("ftp://127.0.0.1/file.txt"); urlup.setPassword("123"); urlup.setUserName("user"); urlup.setPort(21); QNetworkAccessManager *nam = new QNetworkAccessManager; QNetworkRequest requp(urlup); nam->put(requp,&file); file.close(); but it's not

How do I get a signal from QNetworkAccessManager::networkAccessibleChanged()?

折月煮酒 提交于 2019-12-21 23:52:42
问题 I am using the QNetworkAccessManager to do HTTP requests. We have found that the network connection we are using can go offline occasionally, and I want to actively detect when the link goes down. I have connected a slot to the QNetworkAccessManager::networkAccessibleChanged() signal, but am not seeing any output from my slot. In searching for a solution, the closest I come to an answer is the following discussion: http://www.qtcentre.org/threads/37514-use-of-QNetworkAccessManager