How to know if QNetworkReply has a body?
Solved
General and Desktop
-
Hi and welcome to devnet,
There's nothing like that. You have to parse the content of the reply that you received.
-
Yes, but checking for empty depends on what request you did. You can have a valid empty answer i.e. status code 200 for an operation that doesn't answer anything particular.
-
@SGaist Yes, I know, I'm making a few tests with a local server and that is exactly the idea, to check if the body is empty, not the status code or anything else, only if the body is empty.
I thought that Qt would have a method or something like
hasBody
, but I can live with that.Thank you.
-
You're welcome !
Since the point has been clarified, please mark the thread as solved using the "Topic Tool" button so other forum users may know a solution has been found :)