[Qt-jambi-interest] Problem with QHttp Example

Pablo Terradillos tehsis at gmail.com
Tue Jul 15 13:42:43 CEST 2008


Hi all, this is my first message in this list.

I've been trying to  make use of QHttp reproducing the example given at 
http://doc.trolltech.com/qtjambi-4.4/html/index.html

I've just copy and paste this piece of code

    QHttp http = new QHttp();
    QHttpRequestHeader header = new QHttpRequestHeader("GET", "/index.html");
    header.setValue("Host", "www.trolltech.com");
    http.setHost("www.trolltech.com", 80);
    http.request(header);


But Eclipse complains about setValue, setHost and request's methods... 
"Misplaced construct" and "Invalid token".
Ok, i can figure out what the problem is, but not how to fix it... this 
code is given by the example of the page so i supposed it to be 
correct... besides, i have to say it, i am a newby with Qt,Jambi and 
Java, so please excuse me, if a did a stupid question with this, but i 
can't not solve this...

Te packages i import are:

import com.trolltech.qt.gui.*;
import com.trolltech.qt.network.QHttp;
import com.trolltech.qt.network.QHttpRequestHeader;

thanks in advance.



More information about the Qt-jambi-interest mailing list