View Full Version : QHttp help please

12th September 2006, 08:29

I want to post a few logs to a php script. Below is my code.

QString str;
QTime t, t1;
for(int i=0;i<noOfSeconds;i++){
t= QTime::currentTime();
for(int j=0;j<logsPerSecond;j++){
QString log = GenerateLog();
QHttpRequestHeader header( "POST", "someFile.php" ) ;
header.setValue( "Host", ipAddress ) ;
header.setContentType( "application/x-www-form-urlencoded" ) ;
t1 = QTime::currentTime();
while(t1 < t) {
t1= QTime::currentTime();

Is the above code correct ? Can I call request() in a loop and will it be queued ?

I tried it with an example where both the loops are called for 5 times but the logs are posted only once.

Please help
Thanks a lot.

12th September 2006, 08:38
Sorry guys.

It works. Actually it was my mistake.

Sorry once again.

Admins if you want you can delete this thread.