Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 2068

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<class name="QHttp" doc="/**
&lt;p&gt;The &lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; class provides an implementation of the HTTP protocol.&lt;/p&gt;
&lt;p&gt;This class provides a direct interface to HTTP that allows you to have more control over the requests and that allows you to access the response header fields.&lt;/p&gt;
&lt;p&gt;The class works asynchronously, so there are no blocking functions. If an operation cannot be executed immediately, the function will still return straight away and the operation will be scheduled for later execution. The results of scheduled operations are reported via signals. This approach depends on the event loop being in operation.&lt;/p&gt;
&lt;p&gt;The operations that can be scheduled (they are called &amp;quot;requests&amp;quot; in the rest of the documentation) are the following: setHost(), &lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#head(java.lang.String)&quot;&gt;&lt;tt&gt;head&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;All of these requests return a unique identifier that allows you to keep track of the request that is currently executed. When the execution of a request starts, the &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; signal with the identifier is emitted and when the request is finished, the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal is emitted with the identifier and a bool that indicates if the request finished with an error.&lt;/p&gt;
&lt;p&gt;To make an HTTP request you must set up suitable HTTP headers. The following example demonstrates, how to request the main HTML page from the Trolltech home page (i.e&amp;#x2e; the URL &lt;tt&gt;http:&lt;span class=&quot;comment&quot;&gt;//www.trolltech.com/index.html&lt;/span&gt;&lt;/tt&gt;):&lt;/p&gt;
&lt;pre&gt;    QHttpRequestHeader header(&amp;quot;GET&amp;quot;, &amp;quot;/index.html&amp;quot;);
    header.setValue(&amp;quot;Host&amp;quot;, &amp;quot;www.trolltech.com&amp;quot;);
    http-&amp;gt;setHost(&amp;quot;www.trolltech.com&amp;quot;);
    http-&amp;gt;request(header);&lt;/pre&gt;
&lt;p&gt;For the common HTTP requests &lt;tt&gt;GET&lt;/tt&gt;, &lt;tt&gt;POST&lt;/tt&gt; and &lt;tt&gt;HEAD&lt;/tt&gt;, &lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; provides the convenience functions &lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#head(java.lang.String)&quot;&gt;&lt;tt&gt;head&lt;/tt&gt;&lt;/a&gt;. They already use a reasonable header and if you don't have to set special header fields, they are easier to use. The above example can also be written as:&lt;/p&gt;
&lt;pre&gt;    http-&amp;gt;setHost(&amp;quot;www.trolltech.com&amp;quot;); &lt;span class=&quot;comment&quot;&gt;// id == 1&lt;/span&gt;
    http-&amp;gt;get(&amp;quot;/index.html&amp;quot;);           &lt;span class=&quot;comment&quot;&gt;// id == 2&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;For this example the following sequence of signals is emitted (with small variations, depending on network traffic, etc.):&lt;/p&gt;
&lt;pre&gt;    requestStarted(1)
    requestFinished(1, false)

    requestStarted(2)
    stateChanged(Connecting)
    stateChanged(Sending)
    dataSendProgress(77, 77)
    stateChanged(Reading)
    responseHeaderReceived(responseheader)
    dataReadProgress(5388, 0)
    readyRead(responseheader)
    dataReadProgress(18300, 0)
    readyRead(responseheader)
    stateChanged(Connected)
    requestFinished(2, false)

    done(false)

    stateChanged(Closing)
    stateChanged(Unconnected)&lt;/pre&gt;
&lt;p&gt;The &lt;a href=&quot;QHttp.html#dataSendProgress(int, int)&quot;&gt;&lt;tt&gt;dataSendProgress&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#dataReadProgress(int, int)&quot;&gt;&lt;tt&gt;dataReadProgress&lt;/tt&gt;&lt;/a&gt; signals in the above example are useful if you want to show a &lt;a href=&quot;%2E%2E/gui/QProgressBar.html&quot;&gt;progress bar&lt;/tt&gt;&lt;/a&gt; to inform the user about the progress of the download. The second argument is the total size of data. In certain cases it is not possible to know the total amount in advance, in which case the second argument is 0. (If you connect to a &lt;a href=&quot;%2E%2E/gui/QProgressBar.html&quot;&gt;&lt;tt&gt;QProgressBar&lt;/tt&gt;&lt;/a&gt; a total of 0 results in a busy indicator.)&lt;/p&gt;
&lt;p&gt;When the response header is read, it is reported with the &lt;a href=&quot;QHttp.html#responseHeaderReceived(com.trolltech.qt.network.QHttpResponseHeader)&quot;&gt;&lt;tt&gt;responseHeaderReceived&lt;/tt&gt;&lt;/a&gt; signal.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;QHttp.html#readyRead(com.trolltech.qt.network.QHttpResponseHeader)&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt; signal tells you that there is data ready to be read. The amount of data can then be queried with the &lt;a href=&quot;QHttp.html#bytesAvailable()&quot;&gt;&lt;tt&gt;bytesAvailable&lt;/tt&gt;&lt;/a&gt; function and it can be read with the read() or &lt;a href=&quot;QHttp.html#readAll()&quot;&gt;&lt;tt&gt;readAll&lt;/tt&gt;&lt;/a&gt; functions.&lt;/p&gt;
&lt;p&gt;If an error occurs during the execution of one of the commands in a sequence of commands, all the pending commands (i.e&amp;#x2e; scheduled, but not yet executed commands) are cleared and no signals are emitted for them.&lt;/p&gt;
&lt;p&gt;For example, if you have the following sequence of requests&lt;/p&gt;
&lt;pre&gt;    http-&amp;gt;setHost(&amp;quot;www.foo.bar&amp;quot;);       &lt;span class=&quot;comment&quot;&gt;// id == 1&lt;/span&gt;
    http-&amp;gt;get(&amp;quot;/index.html&amp;quot;);           &lt;span class=&quot;comment&quot;&gt;// id == 2&lt;/span&gt;
    http-&amp;gt;post(&amp;quot;register.html&amp;quot;, data);  &lt;span class=&quot;comment&quot;&gt;// id == 3&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;and the &lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt; request fails because the host lookup fails, then the &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt; request is never executed and the signals would look like this:&lt;/p&gt;
&lt;pre&gt;    requestStarted(1)
    requestFinished(1, false)

    requestStarted(2)
    stateChanged(HostLookup)
    requestFinished(2, true)

    done(true)

    stateChanged(Unconnected)&lt;/pre&gt;
&lt;p&gt;You can then get details about the error with the &lt;a href=&quot;QHttp.html#error()&quot;&gt;&lt;tt&gt;error&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#errorString()&quot;&gt;&lt;tt&gt;errorString&lt;/tt&gt;&lt;/a&gt; functions. Note that only unexpected behavior, like network failure is considered as an error. If the server response contains an error status, like a 404 response, this is reported as a normal response case. So you should always check the status code&lt;/tt&gt; of the response header.&lt;/p&gt;
&lt;p&gt;The functions &lt;a href=&quot;QHttp.html#currentId()&quot;&gt;&lt;tt&gt;currentId&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#currentRequest()&quot;&gt;&lt;tt&gt;currentRequest&lt;/tt&gt;&lt;/a&gt; provide more information about the currently executing request.&lt;/p&gt;
&lt;p&gt;The functions &lt;a href=&quot;QHttp.html#hasPendingRequests()&quot;&gt;&lt;tt&gt;hasPendingRequests&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#clearPendingRequests()&quot;&gt;&lt;tt&gt;clearPendingRequests&lt;/tt&gt;&lt;/a&gt; allow you to query and clear the list of pending requests.&lt;/p&gt;

@see &lt;a href=&quot;QFtp.html&quot;&gt;&lt;tt&gt;QFtp&lt;/tt&gt;&lt;/a&gt;
@see HTTP Example&lt;/tt&gt;
@see Torrent Example&lt;/tt&gt; */">
    <signal name="protected final void authenticationRequiredPrivate(java.lang.String hostname, char port, com.trolltech.qt.network.QAuthenticator arg__3)" doc="/**
&lt;p&gt;This signal can be emitted when a web server on a given &lt;tt&gt;hostname&lt;/tt&gt; and &lt;tt&gt;port&lt;/tt&gt; requires authentication. The &lt;tt&gt;arg__3&lt;/tt&gt; object can then be filled in with the required details to allow authentication and continue the connection.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; It is not possible to use a QueuedConnection to connect to this signal, as the connection will fail if the authenticator has not been filled in with new information when the signal returns.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(java.lang.String hostname, char port, com.trolltech.qt.network.QAuthenticator arg__3)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(java.lang.String hostname, char port)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(java.lang.String hostname)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAuthenticator.html&quot;&gt;&lt;tt&gt;QAuthenticator&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QNetworkProxy.html&quot;&gt;&lt;tt&gt;QNetworkProxy&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void dataReadProgress(int arg__1, int arg__2)" doc="/**
&lt;p&gt;This signal is emitted when this object reads data from a HTTP server to indicate the current progress of the download.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;arg__1&lt;/tt&gt; is the amount of data that has already arrived and &lt;tt&gt;arg__2&lt;/tt&gt; is the total amount of data. It is possible that the total amount of data that should be transferred cannot be determined, in which case &lt;tt&gt;arg__2&lt;/tt&gt; is 0.(If you connect to a &lt;a href=&quot;%2E%2E/gui/QProgressBar.html&quot;&gt;&lt;tt&gt;QProgressBar&lt;/tt&gt;&lt;/a&gt;, the progress bar shows a busy indicator if the total is 0).&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Warning:&lt;/b&gt; &lt;tt&gt;arg__1&lt;/tt&gt; and &lt;tt&gt;arg__2&lt;/tt&gt; are not necessarily the size in bytes, since for large files these values might need to be &amp;quot;scaled&amp;quot; to avoid overflow.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(int arg__1, int arg__2)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(int arg__1)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QHttp.html#dataSendProgress(int, int)&quot;&gt;&lt;tt&gt;dataSendProgress&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;%2E%2E/gui/QProgressBar.html&quot;&gt;&lt;tt&gt;QProgressBar&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void dataSendProgress(int arg__1, int arg__2)" doc="/**
&lt;p&gt;This signal is emitted when this object sends data to a HTTP server to inform it about the progress of the upload.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;arg__1&lt;/tt&gt; is the amount of data that has already arrived and &lt;tt&gt;arg__2&lt;/tt&gt; is the total amount of data. It is possible that the total amount of data that should be transferred cannot be determined, in which case &lt;tt&gt;arg__2&lt;/tt&gt; is 0.(If you connect to a &lt;a href=&quot;%2E%2E/gui/QProgressBar.html&quot;&gt;&lt;tt&gt;QProgressBar&lt;/tt&gt;&lt;/a&gt;, the progress bar shows a busy indicator if the total is 0).&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Warning:&lt;/b&gt; &lt;tt&gt;arg__1&lt;/tt&gt; and &lt;tt&gt;arg__2&lt;/tt&gt; are not necessarily the size in bytes, since for large files these values might need to be &amp;quot;scaled&amp;quot; to avoid overflow.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(int arg__1, int arg__2)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(int arg__1)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QHttp.html#dataReadProgress(int, int)&quot;&gt;&lt;tt&gt;dataReadProgress&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;%2E%2E/gui/QProgressBar.html&quot;&gt;&lt;tt&gt;QProgressBar&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void done(boolean arg__1)" doc="/**
&lt;p&gt;This signal is emitted when the last pending request has finished; (it is emitted after the last request's &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal). &lt;tt&gt;arg__1&lt;/tt&gt; is true if an error occurred during the processing; otherwise &lt;tt&gt;arg__1&lt;/tt&gt; is false.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(boolean arg__1)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#error()&quot;&gt;&lt;tt&gt;error&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#errorString()&quot;&gt;&lt;tt&gt;errorString&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void proxyAuthenticationRequiredPrivate(com.trolltech.qt.network.QNetworkProxy proxy, com.trolltech.qt.network.QAuthenticator arg__2)" doc="/**
&lt;p&gt;This signal can be emitted when a &lt;tt&gt;proxy&lt;/tt&gt; that requires authentication is used. The &lt;tt&gt;arg__2&lt;/tt&gt; object can then be filled in with the required details to allow authentication and continue the connection.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; It is not possible to use a QueuedConnection to connect to this signal, as the connection will fail if the authenticator has not been filled in with new information when the signal returns.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.network.QNetworkProxy proxy, com.trolltech.qt.network.QAuthenticator arg__2)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.network.QNetworkProxy proxy)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QAuthenticator.html&quot;&gt;&lt;tt&gt;QAuthenticator&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QNetworkProxy.html&quot;&gt;&lt;tt&gt;QNetworkProxy&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void readyRead(com.trolltech.qt.network.QHttpResponseHeader resp)" doc="/**
&lt;p&gt;This signal is emitted when there is new response data to read.&lt;/p&gt;
&lt;p&gt;If you specified a device in the request where the data should be written to, then this signal is &lt;i&gt;not&lt;/i&gt; emitted; instead the data is written directly to the device.&lt;/p&gt;
&lt;p&gt;The response header is passed in &lt;tt&gt;resp&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;You can read the data with the &lt;a href=&quot;QHttp.html#readAll()&quot;&gt;&lt;tt&gt;readAll&lt;/tt&gt;&lt;/a&gt; or read() functions&lt;/p&gt;
&lt;p&gt;This signal is useful if you want to process the data in chunks as soon as it becomes available. If you are only interested in the complete data, just connect to the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal and read the data then instead.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.network.QHttpResponseHeader resp)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#readAll()&quot;&gt;&lt;tt&gt;readAll&lt;/tt&gt;&lt;/a&gt;, &lt;tt&gt;read&lt;/tt&gt;, &lt;a href=&quot;QHttp.html#bytesAvailable()&quot;&gt;&lt;tt&gt;bytesAvailable&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void requestFinished(int arg__1, boolean arg__2)" doc="/**
&lt;p&gt;This signal is emitted when processing the request identified by &lt;tt&gt;arg__1&lt;/tt&gt; has finished. &lt;tt&gt;arg__2&lt;/tt&gt; is true if an error occurred during the processing; otherwise &lt;tt&gt;arg__2&lt;/tt&gt; is false.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(int arg__1, boolean arg__2)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(int arg__1)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#done(boolean)&quot;&gt;&lt;tt&gt;done&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#error()&quot;&gt;&lt;tt&gt;error&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#errorString()&quot;&gt;&lt;tt&gt;errorString&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void requestStarted(int arg__1)" doc="/**
&lt;p&gt;This signal is emitted when processing the request identified by &lt;tt&gt;arg__1&lt;/tt&gt; starts.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(int arg__1)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#done(boolean)&quot;&gt;&lt;tt&gt;done&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void responseHeaderReceived(com.trolltech.qt.network.QHttpResponseHeader resp)" doc="/**
&lt;p&gt;This signal is emitted when the HTTP header of a server response is available. The header is passed in &lt;tt&gt;resp&lt;/tt&gt;.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(com.trolltech.qt.network.QHttpResponseHeader resp)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#head(java.lang.String)&quot;&gt;&lt;tt&gt;head&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#readyRead(com.trolltech.qt.network.QHttpResponseHeader)&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void stateChanged(int arg__1)" doc="/**
&lt;p&gt;This signal is emitted when the state of the &lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; object changes. The argument &lt;tt&gt;arg__1&lt;/tt&gt; is the new state of the connection; it is one of the &lt;a href=&quot;QHttp.html#State-enum&quot;&gt;State&lt;/tt&gt;&lt;/a&gt; values.&lt;/p&gt;
&lt;p&gt;This usually happens when a request is started, but it can also happen when the server closes the connection or when a call to &lt;a href=&quot;QHttp.html#close()&quot;&gt;&lt;tt&gt;close&lt;/tt&gt;&lt;/a&gt; succeeded.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(int arg__1)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#head(java.lang.String)&quot;&gt;&lt;tt&gt;head&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#close()&quot;&gt;&lt;tt&gt;close&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#state()&quot;&gt;&lt;tt&gt;state&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#State-enum&quot;&gt;State&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <method name="public QHttp(com.trolltech.qt.core.QObject parent)" doc="/**
&lt;p&gt;Constructs a &lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; object. The &lt;tt&gt;parent&lt;/tt&gt; parameter is passed on to the &lt;a href=&quot;%2E%2E/core/%2E%2E/core/QObject.html#QObject(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QObject&lt;/tt&gt;&lt;/a&gt; constructor.&lt;/p&gt;
 */"/>
    <method name="public QHttp()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt;(0). */"/>
    <method name="public final void abort()" doc="/**
&lt;p&gt;Aborts the current request and deletes all scheduled requests.&lt;/p&gt;
&lt;p&gt;For the current request, the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal with the &lt;tt&gt;error&lt;/tt&gt; argument &lt;tt&gt;true&lt;/tt&gt; is emitted. For all other requests that are affected by the &lt;a href=&quot;QHttp.html#abort()&quot;&gt;&lt;tt&gt;abort&lt;/tt&gt;&lt;/a&gt;, no signals are emitted.&lt;/p&gt;
&lt;p&gt;Since this slot also deletes the scheduled requests, there are no requests left and the &lt;a href=&quot;QHttp.html#done(boolean)&quot;&gt;&lt;tt&gt;done&lt;/tt&gt;&lt;/a&gt; signal is emitted (with the &lt;tt&gt;error&lt;/tt&gt; argument &lt;tt&gt;true&lt;/tt&gt;).&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#clearPendingRequests()&quot;&gt;&lt;tt&gt;clearPendingRequests&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final long bytesAvailable()" doc="/**
&lt;p&gt;Returns the number of bytes that can be read from the response content at the moment.&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#readyRead(com.trolltech.qt.network.QHttpResponseHeader)&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;read&lt;/tt&gt;
@see &lt;a href=&quot;QHttp.html#readAll()&quot;&gt;&lt;tt&gt;readAll&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void clearPendingRequests()" doc="/**
&lt;p&gt;Deletes all pending requests from the list of scheduled requests. This does not affect the request that is being executed. If you want to stop this this as well, use &lt;a href=&quot;QHttp.html#abort()&quot;&gt;&lt;tt&gt;abort&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#hasPendingRequests()&quot;&gt;&lt;tt&gt;hasPendingRequests&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#abort()&quot;&gt;&lt;tt&gt;abort&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int close()" doc="/**
&lt;p&gt;Closes the connection; this is useful if you have a keep-alive connection and want to close it.&lt;/p&gt;
&lt;p&gt;For the requests issued with &lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#head(java.lang.String)&quot;&gt;&lt;tt&gt;head&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; sets the connection to be keep-alive. You can also do this using the header you pass to the &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt; function. &lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; only closes the connection to the HTTP server if the response header requires it to do so.&lt;/p&gt;
&lt;p&gt;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 &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When the request is started the &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; signal is emitted. When it is finished the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal is emitted.&lt;/p&gt;
&lt;p&gt;If you want to close the connection immediately, you have to use &lt;a href=&quot;QHttp.html#abort()&quot;&gt;&lt;tt&gt;abort&lt;/tt&gt;&lt;/a&gt; instead.&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#stateChanged(int)&quot;&gt;&lt;tt&gt;stateChanged&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#abort()&quot;&gt;&lt;tt&gt;abort&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#done(boolean)&quot;&gt;&lt;tt&gt;done&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.core.QIODevice currentDestinationDevice()" doc="/**
&lt;p&gt;Returns the &lt;a href=&quot;%2E%2E/core/QIODevice.html&quot;&gt;&lt;tt&gt;QIODevice&lt;/tt&gt;&lt;/a&gt; pointer that is used as to store the data of the HTTP request being executed. If there is no current request or if the request does not store the data to an IO device, this function returns 0.&lt;/p&gt;
&lt;p&gt;This function can be used to delete the &lt;a href=&quot;%2E%2E/core/QIODevice.html&quot;&gt;&lt;tt&gt;QIODevice&lt;/tt&gt;&lt;/a&gt; in the slot connected to the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal.&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#currentSourceDevice()&quot;&gt;&lt;tt&gt;currentSourceDevice&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int currentId()" doc="/**
&lt;p&gt;Returns the identifier of the HTTP request being executed or 0 if there is no request being executed (i.e&amp;#x2e; they've all finished).&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#currentRequest()&quot;&gt;&lt;tt&gt;currentRequest&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.network.QHttpRequestHeader currentRequest()" doc="/**
&lt;p&gt;Returns the request header of the HTTP request being executed. If the request is one issued by setHost() or &lt;a href=&quot;QHttp.html#close()&quot;&gt;&lt;tt&gt;close&lt;/tt&gt;&lt;/a&gt;, it returns an invalid request header, i.e&amp;#x2e; QHttpRequestHeader::isValid() returns false.&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#currentId()&quot;&gt;&lt;tt&gt;currentId&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.core.QIODevice currentSourceDevice()" doc="/**
&lt;p&gt;Returns the &lt;a href=&quot;%2E%2E/core/QIODevice.html&quot;&gt;&lt;tt&gt;QIODevice&lt;/tt&gt;&lt;/a&gt; pointer that is used as the data source of the HTTP request being executed. If there is no current request or if the request does not use an IO device as the data source, this function returns 0.&lt;/p&gt;
&lt;p&gt;This function can be used to delete the &lt;a href=&quot;%2E%2E/core/QIODevice.html&quot;&gt;&lt;tt&gt;QIODevice&lt;/tt&gt;&lt;/a&gt; in the slot connected to the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal.&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#currentDestinationDevice()&quot;&gt;&lt;tt&gt;currentDestinationDevice&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.network.QHttp.Error error()" doc="/**
&lt;p&gt;Returns the last error that occurred. This is useful to find out what happened when receiving a &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; or a &lt;a href=&quot;QHttp.html#done(boolean)&quot;&gt;&lt;tt&gt;done&lt;/tt&gt;&lt;/a&gt; signal with the &lt;tt&gt;error&lt;/tt&gt; argument &lt;tt&gt;true&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;If you start a new request, the error status is reset to &lt;tt&gt;NoError&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public final java.lang.String errorString()" doc="/**
&lt;p&gt;Returns a human-readable description of the last error that occurred. This is useful to present a error message to the user when receiving a &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; or a &lt;a href=&quot;QHttp.html#done(boolean)&quot;&gt;&lt;tt&gt;done&lt;/tt&gt;&lt;/a&gt; signal with the &lt;tt&gt;error&lt;/tt&gt; argument &lt;tt&gt;true&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public final int get(java.lang.String path, com.trolltech.qt.core.QIODevice to)" doc="/**
&lt;p&gt;Sends a get request for &lt;tt&gt;path&lt;/tt&gt; to the server set by setHost() or as specified in the constructor.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;path&lt;/tt&gt; must be an absolute path like &lt;tt&gt;/index.html&lt;/tt&gt; or an absolute URI like &lt;tt&gt;http:&lt;span class=&quot;comment&quot;&gt;//www.trolltech.com/index.html&lt;/span&gt;&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;If the IO device &lt;tt&gt;to&lt;/tt&gt; is 0 the &lt;a href=&quot;QHttp.html#readyRead(com.trolltech.qt.network.QHttpResponseHeader)&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt; signal is emitted every time new content data is available to read.&lt;/p&gt;
&lt;p&gt;If the IO device &lt;tt&gt;to&lt;/tt&gt; is not 0, the content data of the response is written directly to the device. Make sure that the &lt;tt&gt;to&lt;/tt&gt; pointer is valid for the duration of the operation (it is safe to delete it when the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal is emitted).&lt;/p&gt;
&lt;p&gt;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 &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When the request is started the &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; signal is emitted. When it is finished the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal is emitted.&lt;/p&gt;

@see &lt;tt&gt;setHost&lt;/tt&gt;
@see &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#head(java.lang.String)&quot;&gt;&lt;tt&gt;head&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#done(boolean)&quot;&gt;&lt;tt&gt;done&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int get(java.lang.String path)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;get&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;path&lt;/tt&gt;, 0). */"/>
    <method name="public final boolean hasPendingRequests()" doc="/**
&lt;p&gt;Returns true if there are any requests scheduled that have not yet been executed; otherwise returns false.&lt;/p&gt;
&lt;p&gt;The request that is being executed is &lt;i&gt;not&lt;/i&gt; considered as a scheduled request.&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#clearPendingRequests()&quot;&gt;&lt;tt&gt;clearPendingRequests&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#currentId()&quot;&gt;&lt;tt&gt;currentId&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#currentRequest()&quot;&gt;&lt;tt&gt;currentRequest&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int head(java.lang.String path)" doc="/**
&lt;p&gt;Sends a header request for &lt;tt&gt;path&lt;/tt&gt; to the server set by setHost() or as specified in the constructor.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;path&lt;/tt&gt; must be an absolute path like &lt;tt&gt;/index.html&lt;/tt&gt; or an absolute URI like &lt;tt&gt;http:&lt;span class=&quot;comment&quot;&gt;//www.trolltech.com/index.html&lt;/span&gt;&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;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 &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When the request is started the &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; signal is emitted. When it is finished the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal is emitted.&lt;/p&gt;

@see &lt;tt&gt;setHost&lt;/tt&gt;
@see &lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#done(boolean)&quot;&gt;&lt;tt&gt;done&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void ignoreSslErrors()" doc="/**
&lt;p&gt;Tells the QSslSocket used for the Http connection to ignore the errors reported in the sslErrors() signal.&lt;/p&gt;
&lt;p&gt;Note that this function must be called from within a slot connected to the sslErrors() signal to have any effect.&lt;/p&gt;

@see &lt;tt&gt;QSslSocket&lt;/tt&gt;
@see &lt;tt&gt;QSslSocket::sslErrors&lt;/tt&gt; */"/>
    <method name="public final com.trolltech.qt.network.QHttpResponseHeader lastResponse()" doc="/**
&lt;p&gt;Returns the received response header of the most recently finished HTTP request. If no response has yet been received QHttpResponseHeader::isValid() will return false.&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#currentRequest()&quot;&gt;&lt;tt&gt;currentRequest&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int post(java.lang.String path, com.trolltech.qt.core.QByteArray data, com.trolltech.qt.core.QIODevice to)" doc="/**
&lt;p&gt;&lt;tt&gt;data&lt;/tt&gt; is used as the content data of the HTTP request.&lt;/p&gt;
 */"/>
    <method name="public final int post(java.lang.String path, com.trolltech.qt.core.QByteArray data)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;post&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;path&lt;/tt&gt;, &lt;tt&gt;data&lt;/tt&gt;, 0). */"/>
    <method name="public final int post(java.lang.String path, com.trolltech.qt.core.QIODevice data, com.trolltech.qt.core.QIODevice to)" doc="/**
&lt;p&gt;Sends a post request for &lt;tt&gt;path&lt;/tt&gt; to the server set by setHost() or as specified in the constructor.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;path&lt;/tt&gt; must be an absolute path like &lt;tt&gt;/index.html&lt;/tt&gt; or an absolute URI like &lt;tt&gt;http:&lt;span class=&quot;comment&quot;&gt;//www.trolltech.com/index.html&lt;/span&gt;&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;The incoming data comes via the &lt;tt&gt;data&lt;/tt&gt; IO device.&lt;/p&gt;
&lt;p&gt;If the IO device &lt;tt&gt;to&lt;/tt&gt; is 0 the &lt;a href=&quot;QHttp.html#readyRead(com.trolltech.qt.network.QHttpResponseHeader)&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt; signal is emitted every time new content data is available to read.&lt;/p&gt;
&lt;p&gt;If the IO device &lt;tt&gt;to&lt;/tt&gt; is not 0, the content data of the response is written directly to the device. Make sure that the &lt;tt&gt;to&lt;/tt&gt; pointer is valid for the duration of the operation (it is safe to delete it when the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal is emitted).&lt;/p&gt;
&lt;p&gt;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 &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When the request is started the &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; signal is emitted. When it is finished the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal is emitted.&lt;/p&gt;

@see &lt;tt&gt;setHost&lt;/tt&gt;
@see &lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#head(java.lang.String)&quot;&gt;&lt;tt&gt;head&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#done(boolean)&quot;&gt;&lt;tt&gt;done&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int post(java.lang.String path, com.trolltech.qt.core.QIODevice data)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;post&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;path&lt;/tt&gt;, &lt;tt&gt;data&lt;/tt&gt;, 0). */"/>
    <method name="public final com.trolltech.qt.core.QByteArray readAll()" doc="/**
&lt;p&gt;Reads all the bytes from the response content and returns them.&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;request&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#readyRead(com.trolltech.qt.network.QHttpResponseHeader)&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#bytesAvailable()&quot;&gt;&lt;tt&gt;bytesAvailable&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;read&lt;/tt&gt; */"/>
    <method name="public final int request(com.trolltech.qt.network.QHttpRequestHeader header, com.trolltech.qt.core.QIODevice device, com.trolltech.qt.core.QIODevice to)" doc="/**
&lt;p&gt;Sends a request to the server set by setHost() or as specified in the constructor. Uses the &lt;tt&gt;header&lt;/tt&gt; as the HTTP request header. You are responsible for setting up a header that is appropriate for your request.&lt;/p&gt;
&lt;p&gt;The incoming data comes via the &lt;tt&gt;device&lt;/tt&gt; IO device.&lt;/p&gt;
&lt;p&gt;If the IO device &lt;tt&gt;to&lt;/tt&gt; is 0 the &lt;a href=&quot;QHttp.html#readyRead(com.trolltech.qt.network.QHttpResponseHeader)&quot;&gt;&lt;tt&gt;readyRead&lt;/tt&gt;&lt;/a&gt; signal is emitted every time new content data is available to read.&lt;/p&gt;
&lt;p&gt;If the IO device &lt;tt&gt;to&lt;/tt&gt; is not 0, the content data of the response is written directly to the device. Make sure that the &lt;tt&gt;to&lt;/tt&gt; pointer is valid for the duration of the operation (it is safe to delete it when the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal is emitted).&lt;/p&gt;
&lt;p&gt;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 &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When the request is started the &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; signal is emitted. When it is finished the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal is emitted.&lt;/p&gt;

@see &lt;tt&gt;setHost&lt;/tt&gt;
@see &lt;a href=&quot;QHttp.html#get(java.lang.String, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;get&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#post(java.lang.String, com.trolltech.qt.core.QIODevice, com.trolltech.qt.core.QIODevice)&quot;&gt;&lt;tt&gt;post&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#head(java.lang.String)&quot;&gt;&lt;tt&gt;head&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#done(boolean)&quot;&gt;&lt;tt&gt;done&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int request(com.trolltech.qt.network.QHttpRequestHeader header, com.trolltech.qt.core.QIODevice device)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;request&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;header&lt;/tt&gt;, &lt;tt&gt;device&lt;/tt&gt;, 0). */"/>
    <method name="public final int request(com.trolltech.qt.network.QHttpRequestHeader header)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;request&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;header&lt;/tt&gt;, 0, 0). */"/>
    <method name="public final int request(com.trolltech.qt.network.QHttpRequestHeader header, com.trolltech.qt.core.QByteArray data, com.trolltech.qt.core.QIODevice to)" doc="/**
&lt;p&gt;&lt;tt&gt;data&lt;/tt&gt; is used as the content data of the HTTP request.&lt;/p&gt;
 */"/>
    <method name="public final int request(com.trolltech.qt.network.QHttpRequestHeader header, com.trolltech.qt.core.QByteArray data)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QHttp.html#request(com.trolltech.qt.network.QHttpRequestHeader, com.trolltech.qt.core.QByteArray, com.trolltech.qt.core.QIODevice)&quot;&gt;request&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;header&lt;/tt&gt;, &lt;tt&gt;data&lt;/tt&gt;, 0). */"/>
    <method name="public final int setProxy(java.lang.String host, int port, java.lang.String username, java.lang.String password)" doc="/**
&lt;p&gt;Enables HTTP proxy support, using the proxy server &lt;tt&gt;host&lt;/tt&gt; on port &lt;tt&gt;port&lt;/tt&gt;. &lt;tt&gt;username&lt;/tt&gt; and &lt;tt&gt;password&lt;/tt&gt; can be provided if the proxy server requires authentication.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;    void Ticker::getTicks()
    {
      http = new QHttp(this);
      connect(http, SIGNAL(done(bool)), this, SLOT(showPage()));
      http-&amp;gt;setProxy(&amp;quot;proxy.example.com&amp;quot;, 3128);
      http-&amp;gt;setHost(&amp;quot;ticker.example.com&amp;quot;);
      http-&amp;gt;get(&amp;quot;/ticks.asp&amp;quot;);
    }

    void Ticker::showPage()
    {
      display(http-&amp;gt;readAll());
    }&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; supports non-transparent web proxy servers only, such as the Squid Web proxy cache server (from &lt;a href=&quot;http://www.squid.org/&quot;&gt;http://www.squid.org/&lt;/tt&gt;&lt;/a&gt;). For transparent proxying, such as SOCKS5, use &lt;a href=&quot;QNetworkProxy.html&quot;&gt;&lt;tt&gt;QNetworkProxy&lt;/tt&gt;&lt;/a&gt; instead.&lt;/p&gt;

@see &lt;tt&gt;QFtp::setProxy&lt;/tt&gt; */"/>
    <method name="public final int setProxy(java.lang.String host, int port, java.lang.String username)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QHttp.html#setProxy(com.trolltech.qt.network.QNetworkProxy)&quot;&gt;&lt;tt&gt;setProxy&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;host&lt;/tt&gt;, &lt;tt&gt;port&lt;/tt&gt;, &lt;tt&gt;username&lt;/tt&gt;, QString()). */"/>
    <method name="public final int setProxy(java.lang.String host, int port)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QHttp.html#setProxy(com.trolltech.qt.network.QNetworkProxy)&quot;&gt;&lt;tt&gt;setProxy&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;host&lt;/tt&gt;, &lt;tt&gt;port&lt;/tt&gt;, QString(), QString()). */"/>
    <method name="public final int setProxy(com.trolltech.qt.network.QNetworkProxy proxy)" doc="/**
&lt;p&gt;Enables HTTP proxy support using the proxy settings from &lt;tt&gt;proxy&lt;/tt&gt;.&lt;/p&gt;
 */"/>
    <method name="public final int setSocket(com.trolltech.qt.network.QTcpSocket socket)" doc="/**
&lt;p&gt;Replaces the internal &lt;a href=&quot;QTcpSocket.html&quot;&gt;&lt;tt&gt;QTcpSocket&lt;/tt&gt;&lt;/a&gt; that &lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; uses with &lt;tt&gt;socket&lt;/tt&gt;. This is useful if you want to use your own custom &lt;a href=&quot;QTcpSocket.html&quot;&gt;&lt;tt&gt;QTcpSocket&lt;/tt&gt;&lt;/a&gt; subclass instead of the plain &lt;a href=&quot;QTcpSocket.html&quot;&gt;&lt;tt&gt;QTcpSocket&lt;/tt&gt;&lt;/a&gt; that &lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; uses by default. &lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; does not take ownership of the socket, and will not delete &lt;tt&gt;socket&lt;/tt&gt; when destroyed.&lt;/p&gt;
&lt;p&gt;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 &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When the request is started the &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; signal is emitted. When it is finished the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal is emitted.&lt;/p&gt;
&lt;p&gt;Note: If &lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; is used in a non-GUI thread that runs its own event loop, you must move &lt;tt&gt;socket&lt;/tt&gt; to that thread before calling &lt;a href=&quot;QHttp.html#setSocket(com.trolltech.qt.network.QTcpSocket)&quot;&gt;&lt;tt&gt;setSocket&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

@see &lt;tt&gt;QObject::moveToThread&lt;/tt&gt;
@see &lt;a href=&quot;%2E%2E/threads.html&quot;&gt;Thread Support in Qt&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int setUser(java.lang.String username, java.lang.String password)" doc="/**
&lt;p&gt;This function sets the user name &lt;tt&gt;username&lt;/tt&gt; and password &lt;tt&gt;password&lt;/tt&gt; for web pages that require authentication.&lt;/p&gt;
&lt;p&gt;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 &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When the request is started the &lt;a href=&quot;QHttp.html#requestStarted(int)&quot;&gt;&lt;tt&gt;requestStarted&lt;/tt&gt;&lt;/a&gt; signal is emitted. When it is finished the &lt;a href=&quot;QHttp.html#requestFinished(int, boolean)&quot;&gt;&lt;tt&gt;requestFinished&lt;/tt&gt;&lt;/a&gt; signal is emitted.&lt;/p&gt;
 */"/>
    <method name="public final int setUser(java.lang.String username)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QHttp.html#setUser(java.lang.String, java.lang.String)&quot;&gt;&lt;tt&gt;setUser&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;username&lt;/tt&gt;, QString()). */"/>
    <method name="public final com.trolltech.qt.network.QHttp.State state()" doc="/**
&lt;p&gt;Returns the current state of the object. When the state changes, the &lt;a href=&quot;QHttp.html#stateChanged(int)&quot;&gt;&lt;tt&gt;stateChanged&lt;/tt&gt;&lt;/a&gt; signal is emitted.&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#State-enum&quot;&gt;State&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#stateChanged(int)&quot;&gt;&lt;tt&gt;stateChanged&lt;/tt&gt;&lt;/a&gt; */"/>
    <enum name="Error" doc="/**
&lt;p&gt;This enum identifies the error that occurred.&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#error()&quot;&gt;&lt;tt&gt;error&lt;/tt&gt;&lt;/a&gt; */">
        <enum-value name="NoError" doc="/**
&lt;p&gt;No error occurred.&lt;/p&gt;
 */"/>
        <enum-value name="UnknownError" doc="/**
&lt;p&gt;An error other than those specified above occurred.&lt;/p&gt;
 */"/>
        <enum-value name="HostNotFound" doc="/**
&lt;p&gt;The host name lookup failed.&lt;/p&gt;
 */"/>
        <enum-value name="ConnectionRefused" doc="/**
&lt;p&gt;The server refused the connection.&lt;/p&gt;
 */"/>
        <enum-value name="UnexpectedClose" doc="/**
&lt;p&gt;The server closed the connection unexpectedly.&lt;/p&gt;
 */"/>
        <enum-value name="InvalidResponseHeader" doc="/**
&lt;p&gt;The server sent an invalid response header.&lt;/p&gt;
 */"/>
        <enum-value name="WrongContentLength" doc="/**
&lt;p&gt;The client could not read the content correctly because an error with respect to the content length occurred.&lt;/p&gt;
 */"/>
        <enum-value name="Aborted" doc="/**
&lt;p&gt;The request was aborted with &lt;a href=&quot;QHttp.html#abort()&quot;&gt;&lt;tt&gt;abort&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
 */"/>
        <enum-value name="AuthenticationRequiredError" doc="/**
&lt;p&gt;The web server requires authentication to complete the request.&lt;/p&gt;
 */"/>
        <enum-value name="ProxyAuthenticationRequiredError" doc="/**
&lt;p&gt;&lt;a href=&quot;QHttp.html#QHttp(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QHttp&lt;/tt&gt;&lt;/a&gt; is using a proxy, and the proxy server requires authentication to establish a connection.&lt;/p&gt;
 */"/>
</enum>
    <enum name="ConnectionMode" doc="/**
&lt;p&gt;This enum is used to specify the mode of connection to use:&lt;/p&gt;
&lt;p&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; width=&quot;100%&quot;&gt;
&lt;tr&gt;&lt;th width=&quot;25%&quot;&gt;Constant&lt;/th&gt;&lt;th width=&quot;15%&quot;&gt;Value&lt;/th&gt;&lt;th width=&quot;60%&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;ConnectionModeHttp&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;0&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;The connection is a regular Http connection to the server&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;ConnectionModeHttps&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;1&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;The Https protocol is used and the connection is encrypted using SSL.&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;
&lt;p&gt;When using the Https mode, care should be taken to connect to the sslErrors signal, and handle possible Ssl errors.&lt;/p&gt;

@see &lt;tt&gt;QSslSocket&lt;/tt&gt; */">
        <enum-value name="ConnectionModeHttp" doc="/**
&lt;p&gt;The connection is a regular Http connection to the server&lt;/p&gt;
 */"/>
        <enum-value name="ConnectionModeHttps" doc="/**
&lt;p&gt;The Https protocol is used and the connection is encrypted using SSL.&lt;/p&gt;
 */"/>
</enum>
    <enum name="State" doc="/**
&lt;p&gt;This enum is used to specify the state the client is in:&lt;/p&gt;
&lt;p&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;1&quot; width=&quot;100%&quot;&gt;
&lt;tr&gt;&lt;th width=&quot;25%&quot;&gt;Constant&lt;/th&gt;&lt;th width=&quot;15%&quot;&gt;Value&lt;/th&gt;&lt;th width=&quot;60%&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;Unconnected&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;0&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;There is no connection to the host.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;HostLookup&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;1&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;A host name lookup is in progress.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;Connecting&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;2&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;An attempt to connect to the host is in progress.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;Sending&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;3&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;The client is sending its request to the server.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;Reading&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;4&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;The client's request has been sent and the client is reading the server's response.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;Connected&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;5&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;The connection to the host is open, but the client is neither sending a request, nor waiting for a response.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot;&gt;&lt;tt&gt;Closing&lt;/tt&gt;&lt;/td&gt;&lt;td align=&quot;center&quot; valign=&quot;top&quot;&gt;&lt;tt&gt;6&lt;/tt&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;The connection is closing down, but is not yet closed. (The state will be &lt;tt&gt;Unconnected&lt;/tt&gt; when the connection is closed.)&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;&lt;/p&gt;

@see &lt;a href=&quot;QHttp.html#stateChanged(int)&quot;&gt;&lt;tt&gt;stateChanged&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QHttp.html#state()&quot;&gt;&lt;tt&gt;state&lt;/tt&gt;&lt;/a&gt; */">
        <enum-value name="Unconnected" doc="/**
&lt;p&gt;There is no connection to the host.&lt;/p&gt;
 */"/>
        <enum-value name="HostLookup" doc="/**
&lt;p&gt;A host name lookup is in progress.&lt;/p&gt;
 */"/>
        <enum-value name="Connecting" doc="/**
&lt;p&gt;An attempt to connect to the host is in progress.&lt;/p&gt;
 */"/>
        <enum-value name="Sending" doc="/**
&lt;p&gt;The client is sending its request to the server.&lt;/p&gt;
 */"/>
        <enum-value name="Reading" doc="/**
&lt;p&gt;The client's request has been sent and the client is reading the server's response.&lt;/p&gt;
 */"/>
        <enum-value name="Connected" doc="/**
&lt;p&gt;The connection to the host is open, but the client is neither sending a request, nor waiting for a response.&lt;/p&gt;
 */"/>
        <enum-value name="Closing" doc="/**
&lt;p&gt;The connection is closing down, but is not yet closed. (The state will be &lt;tt&gt;Unconnected&lt;/tt&gt; when the connection is closed.)&lt;/p&gt;
 */"/>
</enum>
</class>