
Originally Posted by
wysota
Come on, man. Simply instead of a "get" request, make a "head" request.
QFile qfFileHeader
("Header.txt");
if (!qfFileHeader.
open(QIODevice::WriteOnly)) { QMessageBox::information(this, tr
("HTTP"),tr
("Unable to save the file %1: %2.").
arg(qsFileName
).
arg(qfFileOut
->errorString
()));
return;
}
qhrhHeaderRespond.setValue("Host", qsHost);
qhHttpRespond->setHost(qsHost, qhconMode, quUrl.port() == -1 ? 0 : quUrl.port());
if (!quUrl.userName().isEmpty())
qhHttpRespond->setUser(quUrl.userName(), quUrl.password());
qhHttpRespond->request(qhrhHeaderRespond, 0, &qfFileHeader);
QFile qfFileHeader("Header.txt");
if (!qfFileHeader.open(QIODevice::WriteOnly)) {
QMessageBox::information(this, tr("HTTP"),tr("Unable to save the file %1: %2.").arg(qsFileName).arg(qfFileOut->errorString()));
return;
}
QHttpRequestHeader qhrhHeaderRespond("HEAD", qbaUrlPath);
qhrhHeaderRespond.setValue("Host", qsHost);
qhHttpRespond->setHost(qsHost, qhconMode, quUrl.port() == -1 ? 0 : quUrl.port());
if (!quUrl.userName().isEmpty())
qhHttpRespond->setUser(quUrl.userName(), quUrl.password());
qhHttpRespond->request(qhrhHeaderRespond, 0, &qfFileHeader);
To copy to clipboard, switch view to plain text mode
it dont get in File Header.txt
Bookmarks