Questions tagged [qnetworkaccessmanager]

The QNetworkAccessManager class allows the application to send network requests and receive replies. QNetworkAccessManager class which holds the common configuration and settings for the requests it sends. It contains the proxy and cache configuration, as well as the signals related to such issues, and reply signals that can be used to monitor the progress of a network operation. One QNetworkAccessManager should be enough for the whole Qt application.

The Network Access API is constructed around one QNetworkAccessManager object, which holds the common configuration and settings for the requests it sends. It contains the proxy and cache configuration, as well as the signals related to such issues, and reply signals that can be used to monitor the progress of a network operation. One QNetworkAccessManager should be enough for the whole Qt application.

Once a QNetworkAccessManager object has been created, the application can use it to send requests over the network. A group of standard functions are supplied that take a request and optional data, and each return a QNetworkReply object. The returned object is used to obtain any data returned in response to the corresponding request.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

406 questions
17
votes
3 answers

QNetworkReply wait for finished

I am using Qt 4.6.3 and the following not-working code QStringList userInfo; QNetworkRequest netRequest(QUrl("http://api.stackoverflow.com/1.1/users/587532")); QNetworkReply *netReply = netman->get(netRequest); // from here onwards not…
yolo
  • 2,757
  • 6
  • 36
  • 65
17
votes
3 answers

How to tell QWebPage not to load specific type of resources?

How to tell QWebPage not to load specific type of resources like js, css or png?
Piotr Dobrogost
  • 41,292
  • 40
  • 236
  • 366
16
votes
3 answers

Basic authentication with Qt (QNetworkAccessManager)

I was trying to perform basic authentication for Twitter from my Qt app. I use QNetworkAccessManager. But I couldn't find any help on this. But I found a program called qsoapmanager which passes credentials in base64 through the header. Maybe I can…
chanux
  • 1,829
  • 4
  • 16
  • 20
14
votes
2 answers

QNetworkReply and QNetworkAccessManager timeout in http request

How do I setup a timeout when I do an http request? I have this code: { QNetworkRequest request; request.setUrl(QUrl("http://www.foo.com")); request.setRawHeader("User-Agent", USER_AGENT.toUtf8()); …
user63898
  • 29,839
  • 85
  • 272
  • 514
13
votes
4 answers

Howto implement SFTP with Qt/QNetworkAccessManager (C++)

I'm new to Qt and I would like to implement FTP and SFTP support for my software. As I googled I discovered that there doesn't exist a sftp library for Qt but it should be possible with QNetworkAccessManager. I tried then to discover on how to…
Michael Weibel
  • 2,857
  • 3
  • 23
  • 25
13
votes
3 answers

Thread count increases a lot, even when deleting the threads

Have an application where I have QOBJects which all contain an QNetworkAccessManager. I am aware of that it's suggested to only have on per application but since I'm making a lot more that 6 calls at the same time, I needed to have it like this. So,…
chikuba
  • 4,229
  • 6
  • 43
  • 75
12
votes
2 answers

QNetworkReply and 301 redirect

I have a webviewer and only want it to only be able to access our webapps, to achieve this I have placed a php header which I look for in my Qt App. This works fine but with one exception and that's with 301 permanent moved status codes. Modern…
Kal
  • 2,239
  • 6
  • 36
  • 74
9
votes
1 answer

QNetworkRequest and default SSL configuration

I'm using the following piece of code to make HTTPS requests with a server. QNetworkRequest request; //request.setSslConfiguration(QSslConfiguration::defaultConfiguration()); request.setUrl(QUrl("https://www.someurl.com/")); QNetworkReply *reply =…
Routa
  • 565
  • 3
  • 6
  • 14
9
votes
1 answer

Uploading files using Qt QNetworkRequest

I've been having some issues trying to upload files to a server using QNetworkRequest. I've been using this link (http://qt-project.org/forums/viewthread/11361) mostly as a template, but am still getting POST errors (203 to be specific). Here is…
Rob_S
  • 111
  • 1
  • 6
8
votes
3 answers

Qt5 posting data to server using QUrl / QNetworkRequest

I have a piece of code that worked in 4.8 but now I need to port it to Qt5 (beta2) This is what should happen: I want to post some data to a webserver the url should look like this "http://server/actions.php" Then my fields (a "Action" -string and a…
Artis De Partis
  • 311
  • 5
  • 13
7
votes
6 answers

QObject: Cannot create children for a parent that is in a different thread

EDIT: I tried doing what you guys told me in comments ... : Citizen * c = new Citizen(this); QThread thread; c->moveToThread(&thread); connect(&thread, SIGNAL(started()), c, SLOT(ProcessActions())); thread.start(); This produces even more…
liliumdev
  • 1,159
  • 4
  • 13
  • 25
7
votes
2 answers

QT HTTP Post issue when server requires cookies

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…
shadyabhi
  • 16,675
  • 26
  • 80
  • 131
7
votes
1 answer

QNetworkAccessManager - first GET very slow

I have a problem with using the QNetworkAccessManager in Qt 5.5 on android. Downloading a simple, small graphic file via http GET results in a lot of garbage collection calls and a lockup of the UI during that time. Subsequent GETs work flawlessly…
Aerius
  • 588
  • 5
  • 24
7
votes
2 answers

Uploading a file using post() method of QNetworkAccessManager

I'm having some trouble with a Qt application; specifically with the QNetworkAccessManager class. I'm attempting to perform a simple HTTP upload of a binary file using the post() method of the QNetworkAccessManager. The documentation states that I…
dbisdorf
  • 177
  • 2
  • 3
  • 15
7
votes
4 answers

QNetworkAccessManager: post http multipart from serial QIODevice

I'm trying to use QNetworkAccessManager to upload http multiparts to a dedicated server. The multipart consists of a JSON part describing the data being uploaded. The data is read from a serial QIODevice, which encrypts the data. This is the code…
matejk
  • 798
  • 1
  • 14
  • 27
1
2 3
26 27