Questions tagged [qnetworkrequest]

The QNetworkRequest class, part of the Qt framework, holds a request to be sent with QNetworkAccessManager.

QNetworkRequest is part of the Network Access API and is the class holding the information necessary to send a request over the network. It contains a URL and some ancillary information that can be used to modify the request.

Documentation can be found here for Qt 4.8 and here for Qt 5.

94 questions
10
votes
1 answer

Accessing QNetworkRequest data before it's sent

Is there any way to see the data that will be sent (or has been sent) during (or after) a call to QNetworkAccessManager::post(QNetworkRequest,QByteArray) on the client side? In other words, I would like to see the raw HTTP request in it's…
user336063
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
8
votes
1 answer

Get http code request

U use QNetworkRequest to send post request. How can I get HTTP code of request? I send some request to server, on server I can see my request, but i have to check http code which server will return to application.
Mike
  • 860
  • 14
  • 24
6
votes
2 answers

Persistent connection using QNetworkAccessManager in Qt

I'm trying to maintain a persistent connection between client and Remote server using Qt. My sever side is fine. I'm doing my client side in Qt. Here I will be using QNetworkAccessManager for requesting server with get method(Part of QNetworkRequest…
vgokul129
  • 777
  • 12
  • 31
6
votes
4 answers

Qt - Getting source (HTML code) of a web page hosted on the internet

I want to get the source (HTML) of a webpage, for example the homepage of StackOverflow. This is what I've coded so far: QNetworkAccessManager manager; QNetworkReply *response = manager.get(QNetworkRequest(QUrl(url))); QString html =…
Alaa Salah
  • 1,047
  • 3
  • 12
  • 28
5
votes
3 answers

QNetworkAccessManager - How to send "PATCH" request

I am trying to send a "PATCH" request to my firebase application.As far as I read QNetworkManager doesn't support "Patch" request. How can I send "PATCH" request ?
5
votes
2 answers

How to configure OpenSSL on the QT

How can I make my QwebView/QNetWorkRequest work with SSL? QT return this errors (is clear that the error occurs because I did not configure SSL in my application): QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf QSslSocket: cannot…
Protomen
  • 9,471
  • 9
  • 57
  • 124
5
votes
1 answer

File Upload Error With QNetworkAccessManager

I am trying to upload a file to a server using QNetworkAccessManager in Qt 5.0 on CentOS 6.4. I have tried following a few examples online but none of them work. QFTP works just fine but is slow and now deprecated. My code for the upload is: void…
Brianjs
  • 2,079
  • 2
  • 20
  • 32
4
votes
1 answer

QT QNetworkAccessManager to download file from ftp server not working

QNetworkAccessManager *nam = new QNetworkAccessManager(); QUrl url2("ftp://127.0.0.1/test.txt/"); url2.setPassword("12345"); url2.setUserName("user"); QNetworkRequest req(url2); QNetworkReply *reply = nam->get(req); …
user2584587
  • 133
  • 2
  • 10
3
votes
0 answers

QNetworkReply::ProtocolInvalidOperationError while uploading video to youtube

After the authorization, I have called uploadVideo function. However I have taken QNetworkReply::ProtocolInvalidOperationError. this->mOauth is an instance of QOAuth2AuthorizationCodeFlow. Where do I do wrong? Thanks in advance. QNetworkReply *…
3
votes
0 answers

Qt: How to stream data over a singlepart HTTP request in realtime?

I have to stream data over a singlepart HTTP request in real time. The targeted device only handle data when request is like: POST…
N0un
  • 868
  • 8
  • 31
3
votes
1 answer

Read from QNetworkReply write to file

Assume that I have executed a QNetworkRequest and got the appropriated QNetworkReply. If it be a large file (say 1 GB) how can I create a say 4k byte array buffer and read data 4k by 4k into that array and write it at same time into an open file…
epsi1on
  • 561
  • 5
  • 16
3
votes
1 answer

Qt5 QNetworkAccessManager finished signal never emits

I have a very confusing problem. I had a simple project that was downloading files from some ftp servers. It worked very good. Then, I tried implementing that same code into a larger project (first one was a Console App, and the second one is GUI,…
3
votes
1 answer

Qt: connect a signal after a request is sent in QNetworkAccessManager

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 =…
3
votes
1 answer

Request or AccessManager QT

In Google Chrome, when an error occurs in the request to the server, the Google Chrome tries a new request, see LOG wireshark: Note: This second attempt also ocorrre in Firefox and InternetExplorer. Note: WebInspector only appears in a request,…
Protomen
  • 9,471
  • 9
  • 57
  • 124
1
2 3 4 5 6 7