Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

int QHttp::request ( const QHttpRequestHeader header,
QIODevice data = 0,
QIODevice to = 0 

Sends a request to the server set by setHost() or as specified in the constructor. Uses the header as the HTTP request header. You are responsible for setting up a header that is appropriate for your request.

The incoming data comes via the data IO device.

If the IO device to is 0 the readyRead() signal is emitted every time new content data is available to read.

If the IO device to is not 0, the content data of the response is written directly to the device. Make sure that the to pointer is valid for the duration of the operation (it is safe to delete it when the requestFinished() signal is emitted).

The function does not block and returns immediately. The request is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by requestStarted() and requestFinished().

When the request is started the requestStarted() signal is emitted. When it is finished the requestFinished() signal is emitted.

See also:
setHost() get() post() head() requestStarted() requestFinished() done()

Definition at line 2118 of file qhttp.cpp.

    return d->addRequest(new QHttpNormalRequest(header, data, to));

Generated by  Doxygen 1.6.0   Back to index