Compare QUrl or slot for each response?
Unsolved
Qt WebKit
-
Hi All
I am working on a Qt C++ application.
I am making restAPI requests through my application using QNAM.Currently I am connecting to the replyFinished signal of the QNAM, once the response arrives I am comparing the url's to find out this response is for which request.
Another approach would be to connect to the replyFinished of the QNetworkReply and define different slots for each response.
Which is the best practice for handling such scenarios? When a lot of restAPI calls will be made.
Let me know if you may need more info about my question.
-
@Rizwan94 You could use lambda functions as slots and capture the request object.
-
Hi Thanks for the reply.
So, you mean to say- Connecting to replyFinished of QNetworkReply is better than replyFinished of QNAM
- Rather than defining multiple slots, handle using lambda funtions.
Did I get you right?
-
- I never used QNAM, so do not know whether better to use that one or QNetworkReply
- Yes
4/4