I agree with @shevron's answer, but if the site you're communicating with isn't "clever" enough to implement the HEAD
request, you can still avoid the readAll()
call.
QByteArray line = reply->readLine(); //< eg "HTTP/1.0 200 OK"
QList<QByteArray> chunks = line.split(' ');
QString statusCode = chunks[1];
That should avoid the memory overhead of readAll()
.