~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qnetworkrequest.html

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<!DOCTYPE html
3
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
 
<!-- /fasttmp/mkdist-qt-4.5.2-1245473805/qt-x11-opensource-src-4.5.2/src/network/access/qnetworkrequest.cpp -->
 
5
<!-- qnetworkrequest.cpp -->
6
6
<head>
7
 
  <title>Qt 4.5: QNetworkRequest Class Reference</title>
 
7
  <title>Qt 4.6: QNetworkRequest Class Reference</title>
8
8
  <link href="classic.css" rel="stylesheet" type="text/css" />
9
9
</head>
10
10
<body>
 
11
<a name="//apple_ref/cpp/cl//QNetworkRequest" />
11
12
<table border="0" cellpadding="0" cellspacing="0" width="100%">
12
13
<tr>
13
 
<td align="left" valign="top" width="32"><a href="http://qtsoftware.com/products/qt"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
14
 
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="namespaces.html"><font color="#004faf">All&nbsp;Namespaces</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
15
 
<td align="right" valign="top" width="230"></td></tr></table><h1 class="title">QNetworkRequest Class Reference<br /><span class="small-subtitle">[<a href="qtnetwork.html">QtNetwork</a> module]</span>
 
14
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
 
15
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td><td class="searchBar" align="right" valign="center"><form action="http://www.google.com/cse" id="cse-search-box"><div><input type="hidden" name="cx" value="000136343326384750312:dhbxnqlakyu" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="31" /><input type="submit" name="sa" value="Search" /></div></form></td>
 
16
</tr></table><h1 class="title">QNetworkRequest Class Reference<br /><span class="small-subtitle">[<a href="qtnetwork.html">QtNetwork</a> module]</span>
16
17
</h1>
17
18
<p>The QNetworkRequest class holds one request to be sent with the Network Access API. <a href="#details">More...</a></p>
18
 
<pre> #include &lt;QNetworkRequest&gt;</pre><p>This class was introduced in Qt 4.4.</p>
 
19
<pre> #include &lt;QNetworkRequest&gt;</pre><p><b>This class is not part of the Qt GUI Framework Edition.</b></p>
 
20
<p>This class was introduced in Qt 4.4.</p>
19
21
<ul>
20
22
<li><a href="qnetworkrequest-members.html">List of all members, including inherited members</a></li>
21
23
</ul>
 
24
<hr />
22
25
<a name="public-types"></a>
23
 
<h3>Public Types</h3>
24
 
<ul>
25
 
<li><div class="fn"></div>enum <b><a href="qnetworkrequest.html#Attribute-enum">Attribute</a></b> { HttpStatusCodeAttribute, HttpReasonPhraseAttribute, RedirectionTargetAttribute, ConnectionEncryptedAttribute, ..., UserMax }</li>
26
 
<li><div class="fn"></div>enum <b><a href="qnetworkrequest.html#CacheLoadControl-enum">CacheLoadControl</a></b> { AlwaysNetwork, PreferNetwork, PreferCache, AlwaysCache }</li>
27
 
<li><div class="fn"></div>enum <b><a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a></b> { ContentTypeHeader, ContentLengthHeader, LocationHeader, LastModifiedHeader, CookieHeader, SetCookieHeader }</li>
28
 
</ul>
 
26
<h2>Public Types</h2>
 
27
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
28
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#Attribute-enum">Attribute</a></b> { HttpStatusCodeAttribute, HttpReasonPhraseAttribute, RedirectionTargetAttribute, ConnectionEncryptedAttribute, ..., UserMax }</td></tr>
 
29
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#CacheLoadControl-enum">CacheLoadControl</a></b> { AlwaysNetwork, PreferNetwork, PreferCache, AlwaysCache }</td></tr>
 
30
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a></b> { ContentTypeHeader, ContentLengthHeader, LocationHeader, LastModifiedHeader, CookieHeader, SetCookieHeader }</td></tr>
 
31
</table>
 
32
<hr />
29
33
<a name="public-functions"></a>
30
 
<h3>Public Functions</h3>
31
 
<ul>
32
 
<li><div class="fn"></div><b><a href="qnetworkrequest.html#QNetworkRequest">QNetworkRequest</a></b> ( const QUrl &amp; <i>url</i> = QUrl() )</li>
33
 
<li><div class="fn"></div><b><a href="qnetworkrequest.html#QNetworkRequest-2">QNetworkRequest</a></b> ( const QNetworkRequest &amp; <i>other</i> )</li>
34
 
<li><div class="fn"></div><b><a href="qnetworkrequest.html#dtor.QNetworkRequest">~QNetworkRequest</a></b> ()</li>
35
 
<li><div class="fn"></div>QVariant <b><a href="qnetworkrequest.html#attribute">attribute</a></b> ( Attribute <i>code</i>, const QVariant &amp; <i>defaultValue</i> = QVariant() ) const</li>
36
 
<li><div class="fn"></div>bool <b><a href="qnetworkrequest.html#hasRawHeader">hasRawHeader</a></b> ( const QByteArray &amp; <i>headerName</i> ) const</li>
37
 
<li><div class="fn"></div>QVariant <b><a href="qnetworkrequest.html#header">header</a></b> ( KnownHeaders <i>header</i> ) const</li>
38
 
<li><div class="fn"></div>QByteArray <b><a href="qnetworkrequest.html#rawHeader">rawHeader</a></b> ( const QByteArray &amp; <i>headerName</i> ) const</li>
39
 
<li><div class="fn"></div>QList&lt;QByteArray&gt; <b><a href="qnetworkrequest.html#rawHeaderList">rawHeaderList</a></b> () const</li>
40
 
<li><div class="fn"></div>void <b><a href="qnetworkrequest.html#setAttribute">setAttribute</a></b> ( Attribute <i>code</i>, const QVariant &amp; <i>value</i> )</li>
41
 
<li><div class="fn"></div>void <b><a href="qnetworkrequest.html#setHeader">setHeader</a></b> ( KnownHeaders <i>header</i>, const QVariant &amp; <i>value</i> )</li>
42
 
<li><div class="fn"></div>void <b><a href="qnetworkrequest.html#setRawHeader">setRawHeader</a></b> ( const QByteArray &amp; <i>headerName</i>, const QByteArray &amp; <i>headerValue</i> )</li>
43
 
<li><div class="fn"></div>void <b><a href="qnetworkrequest.html#setSslConfiguration">setSslConfiguration</a></b> ( const QSslConfiguration &amp; <i>config</i> )</li>
44
 
<li><div class="fn"></div>void <b><a href="qnetworkrequest.html#setUrl">setUrl</a></b> ( const QUrl &amp; <i>url</i> )</li>
45
 
<li><div class="fn"></div>QSslConfiguration <b><a href="qnetworkrequest.html#sslConfiguration">sslConfiguration</a></b> () const</li>
46
 
<li><div class="fn"></div>QUrl <b><a href="qnetworkrequest.html#url">url</a></b> () const</li>
47
 
<li><div class="fn"></div>bool <b><a href="qnetworkrequest.html#operator-not-eq">operator!=</a></b> ( const QNetworkRequest &amp; <i>other</i> ) const</li>
48
 
<li><div class="fn"></div>QNetworkRequest &amp; <b><a href="qnetworkrequest.html#operator-eq">operator=</a></b> ( const QNetworkRequest &amp; <i>other</i> )</li>
49
 
<li><div class="fn"></div>bool <b><a href="qnetworkrequest.html#operator-eq-eq">operator==</a></b> ( const QNetworkRequest &amp; <i>other</i> ) const</li>
50
 
</ul>
 
34
<h2>Public Functions</h2>
 
35
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
36
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#QNetworkRequest">QNetworkRequest</a></b> ( const QUrl &amp; <i>url</i> = QUrl() )</td></tr>
 
37
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#QNetworkRequest-2">QNetworkRequest</a></b> ( const QNetworkRequest &amp; <i>other</i> )</td></tr>
 
38
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#dtor.QNetworkRequest">~QNetworkRequest</a></b> ()</td></tr>
 
39
<tr><td class="memItemLeft" align="right" valign="top">QVariant </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#attribute">attribute</a></b> ( Attribute <i>code</i>, const QVariant &amp; <i>defaultValue</i> = QVariant() ) const</td></tr>
 
40
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#hasRawHeader">hasRawHeader</a></b> ( const QByteArray &amp; <i>headerName</i> ) const</td></tr>
 
41
<tr><td class="memItemLeft" align="right" valign="top">QVariant </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#header">header</a></b> ( KnownHeaders <i>header</i> ) const</td></tr>
 
42
<tr><td class="memItemLeft" align="right" valign="top">QByteArray </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#rawHeader">rawHeader</a></b> ( const QByteArray &amp; <i>headerName</i> ) const</td></tr>
 
43
<tr><td class="memItemLeft" align="right" valign="top">QList&lt;QByteArray&gt; </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#rawHeaderList">rawHeaderList</a></b> () const</td></tr>
 
44
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#setAttribute">setAttribute</a></b> ( Attribute <i>code</i>, const QVariant &amp; <i>value</i> )</td></tr>
 
45
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#setHeader">setHeader</a></b> ( KnownHeaders <i>header</i>, const QVariant &amp; <i>value</i> )</td></tr>
 
46
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#setRawHeader">setRawHeader</a></b> ( const QByteArray &amp; <i>headerName</i>, const QByteArray &amp; <i>headerValue</i> )</td></tr>
 
47
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#setSslConfiguration">setSslConfiguration</a></b> ( const QSslConfiguration &amp; <i>config</i> )</td></tr>
 
48
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#setUrl">setUrl</a></b> ( const QUrl &amp; <i>url</i> )</td></tr>
 
49
<tr><td class="memItemLeft" align="right" valign="top">QSslConfiguration </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#sslConfiguration">sslConfiguration</a></b> () const</td></tr>
 
50
<tr><td class="memItemLeft" align="right" valign="top">QUrl </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#url">url</a></b> () const</td></tr>
 
51
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#operator-not-eq">operator!=</a></b> ( const QNetworkRequest &amp; <i>other</i> ) const</td></tr>
 
52
<tr><td class="memItemLeft" align="right" valign="top">QNetworkRequest &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#operator-eq">operator=</a></b> ( const QNetworkRequest &amp; <i>other</i> )</td></tr>
 
53
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qnetworkrequest.html#operator-eq-eq">operator==</a></b> ( const QNetworkRequest &amp; <i>other</i> ) const</td></tr>
 
54
</table>
51
55
<a name="details"></a>
52
56
<hr />
53
57
<h2>Detailed Description</h2>
56
60
<p>See also <a href="qnetworkreply.html">QNetworkReply</a> and <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>.</p>
57
61
<hr />
58
62
<h2>Member Type Documentation</h2>
 
63
<a name="//apple_ref/cpp/tag/QNetworkRequest/Attribute" />
 
64
<a name="//apple_ref/cpp/econst/QNetworkRequest/HttpStatusCodeAttribute" />
 
65
<a name="//apple_ref/cpp/econst/QNetworkRequest/HttpReasonPhraseAttribute" />
 
66
<a name="//apple_ref/cpp/econst/QNetworkRequest/RedirectionTargetAttribute" />
 
67
<a name="//apple_ref/cpp/econst/QNetworkRequest/ConnectionEncryptedAttribute" />
 
68
<a name="//apple_ref/cpp/econst/QNetworkRequest/CacheLoadControlAttribute" />
 
69
<a name="//apple_ref/cpp/econst/QNetworkRequest/CacheSaveControlAttribute" />
 
70
<a name="//apple_ref/cpp/econst/QNetworkRequest/SourceIsFromCacheAttribute" />
 
71
<a name="//apple_ref/cpp/econst/QNetworkRequest/DoNotBufferUploadDataAttribute" />
 
72
<a name="//apple_ref/cpp/econst/QNetworkRequest/HttpPipeliningAllowedAttribute" />
 
73
<a name="//apple_ref/cpp/econst/QNetworkRequest/HttpPipeliningWasUsedAttribute" />
 
74
<a name="//apple_ref/cpp/econst/QNetworkRequest/User" />
 
75
<a name="//apple_ref/cpp/econst/QNetworkRequest/UserMax" />
59
76
<h3 class="fn"><a name="Attribute-enum"></a>enum QNetworkRequest::Attribute</h3>
60
77
<p>Attribute codes for the <a href="qnetworkrequest.html">QNetworkRequest</a> and <a href="qnetworkreply.html">QNetworkReply</a>.</p>
61
78
<p>Attributes are extra meta-data that are used to control the behavior of the request and to pass further information from the reply back to the application. Attributes are also extensible, allowing custom implementations to pass custom values.</p>
62
79
<p>The following table explains what the default attribute codes are, the <a href="qvariant.html">QVariant</a> types associated, the default value if said attribute is missing and whether it's used in requests or replies.</p>
63
 
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
 
80
<p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%">
64
81
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
65
82
<tr><td valign="top"><tt>QNetworkRequest::HttpStatusCodeAttribute</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">Replies only, type: <a href="qvariant.html#Type-enum">QVariant::Int</a> (no default) Indicates the HTTP status code received from the HTTP server (like 200, 304, 404, 401, etc.)&#x2e; If the connection was not HTTP-based, this attribute will not be present.</td></tr>
66
83
<tr><td valign="top"><tt>QNetworkRequest::HttpReasonPhraseAttribute</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Replies only, type: <a href="qvariant.html#Type-enum">QVariant::ByteArray</a> (no default) Indicates the HTTP reason phrase as received from the HTTP server (like &quot;Ok&quot;, &quot;Found&quot;, &quot;Not Found&quot;, &quot;Access Denied&quot;, etc.) This is the human-readable representation of the status code (see above). If the connection was not HTTP-based, this attribute will not be present.</td></tr>
67
84
<tr><td valign="top"><tt>QNetworkRequest::RedirectionTargetAttribute</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Replies only, type: <a href="qvariant.html#Type-enum">QVariant::Url</a> (no default) If present, it indicates that the server is redirecting the request to a different URL. The Network Access API does not by default follow redirections: it's up to the application to determine if the requested redirection should be allowed, according to its security policies.</td></tr>
68
85
<tr><td valign="top"><tt>QNetworkRequest::ConnectionEncryptedAttribute</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">Replies only, type: <a href="qvariant.html#Type-enum">QVariant::Bool</a> (default: false) Indicates whether the data was obtained through an encrypted (secure) connection.</td></tr>
69
86
<tr><td valign="top"><tt>QNetworkRequest::CacheLoadControlAttribute</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">Requests only, type: <a href="qvariant.html#Type-enum">QVariant::Int</a> (default: <a href="qnetworkrequest.html#CacheLoadControl-enum">QNetworkRequest::PreferNetwork</a>) Controls how the cache should be accessed. The possible values are those of <a href="qnetworkrequest.html#CacheLoadControl-enum">QNetworkRequest::CacheLoadControl</a>. Note that the default <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> implementation does not support caching. However, this attribute may be used by certain backends to modify their requests (for example, for caching proxies).</td></tr>
70
 
<tr><td valign="top"><tt>QNetworkRequest::CacheSaveControlAttribute</tt></td><td align="center" valign="top"><tt>5</tt></td><td valign="top">Requests only, type: <a href="qvariant.html#Type-enum">QVariant::Bool</a> (default: true) Controls if the data obtained should be saved to cache for future uses. If the value is false, the data obtained will not be automatically cached. If true, data may be cached, provided it is cacheable (what is cacheable depends on the protocol being used). Note that the default <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> implementation does not support caching, so it will ignore this attribute.</td></tr>
 
87
<tr><td valign="top"><tt>QNetworkRequest::CacheSaveControlAttribute</tt></td><td align="center" valign="top"><tt>5</tt></td><td valign="top">Requests only, type: <a href="qvariant.html#Type-enum">QVariant::Bool</a> (default: true) Controls if the data obtained should be saved to cache for future uses. If the value is false, the data obtained will not be automatically cached. If true, data may be cached, provided it is cacheable (what is cacheable depends on the protocol being used).</td></tr>
71
88
<tr><td valign="top"><tt>QNetworkRequest::SourceIsFromCacheAttribute</tt></td><td align="center" valign="top"><tt>6</tt></td><td valign="top">Replies only, type: <a href="qvariant.html#Type-enum">QVariant::Bool</a> (default: false) Indicates whether the data was obtained from cache or not.</td></tr>
 
89
<tr><td valign="top"><tt>QNetworkRequest::DoNotBufferUploadDataAttribute</tt></td><td align="center" valign="top"><tt>7</tt></td><td valign="top">Requests only, type: <a href="qvariant.html#Type-enum">QVariant::Bool</a> (default: false) Indicates whether the <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> code is allowed to buffer the upload data, e.g&#x2e; when doing a HTTP POST. When using this flag with sequential upload data, the <a href="qnetworkrequest.html#KnownHeaders-enum">ContentLengthHeader</a> header must be set.</td></tr>
 
90
<tr><td valign="top"><tt>QNetworkRequest::HttpPipeliningAllowedAttribute</tt></td><td align="center" valign="top"><tt>8</tt></td><td valign="top">Requests only, type: <a href="qvariant.html#Type-enum">QVariant::Bool</a> (default: false) Indicates whether the <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> code is allowed to use HTTP pipelining with this request.</td></tr>
 
91
<tr><td valign="top"><tt>QNetworkRequest::HttpPipeliningWasUsedAttribute</tt></td><td align="center" valign="top"><tt>9</tt></td><td valign="top">Replies only, type: <a href="qvariant.html#Type-enum">QVariant::Bool</a> Indicates whether the HTTP pipelining was used for receiving this reply.</td></tr>
72
92
<tr><td valign="top"><tt>QNetworkRequest::User</tt></td><td align="center" valign="top"><tt>1000</tt></td><td valign="top">Special type. Additional information can be passed in QVariants with types ranging from User to UserMax. The default implementation of Network Access will ignore any request attributes in this range and it will not produce any attributes in this range in replies. The range is reserved for extensions of <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>.</td></tr>
73
93
<tr><td valign="top"><tt>QNetworkRequest::UserMax</tt></td><td align="center" valign="top"><tt>32767</tt></td><td valign="top">Special type. See User.</td></tr>
74
94
</table></p>
 
95
<a name="//apple_ref/cpp/tag/QNetworkRequest/CacheLoadControl" />
 
96
<a name="//apple_ref/cpp/econst/QNetworkRequest/AlwaysNetwork" />
 
97
<a name="//apple_ref/cpp/econst/QNetworkRequest/PreferNetwork" />
 
98
<a name="//apple_ref/cpp/econst/QNetworkRequest/PreferCache" />
 
99
<a name="//apple_ref/cpp/econst/QNetworkRequest/AlwaysCache" />
75
100
<h3 class="fn"><a name="CacheLoadControl-enum"></a>enum QNetworkRequest::CacheLoadControl</h3>
76
101
<p>Controls the caching mechanism of <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>.</p>
77
 
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
 
102
<p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%">
78
103
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
79
104
<tr><td valign="top"><tt>QNetworkRequest::AlwaysNetwork</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">always load from network and do not check if the cache has a valid entry (similar to the &quot;Reload&quot; feature in browsers)</td></tr>
80
105
<tr><td valign="top"><tt>QNetworkRequest::PreferNetwork</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">default value; load from the network if the cached entry is older than the network entry</td></tr>
81
106
<tr><td valign="top"><tt>QNetworkRequest::PreferCache</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">load from cache if available, otherwise load from network. Note that this can return possibly stale (but not expired) items from cache.</td></tr>
82
107
<tr><td valign="top"><tt>QNetworkRequest::AlwaysCache</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">only load from cache, indicating error if the item was not cached (i.e&#x2e;, off-line mode)</td></tr>
83
108
</table></p>
 
109
<a name="//apple_ref/cpp/tag/QNetworkRequest/KnownHeaders" />
 
110
<a name="//apple_ref/cpp/econst/QNetworkRequest/ContentTypeHeader" />
 
111
<a name="//apple_ref/cpp/econst/QNetworkRequest/ContentLengthHeader" />
 
112
<a name="//apple_ref/cpp/econst/QNetworkRequest/LocationHeader" />
 
113
<a name="//apple_ref/cpp/econst/QNetworkRequest/LastModifiedHeader" />
 
114
<a name="//apple_ref/cpp/econst/QNetworkRequest/CookieHeader" />
 
115
<a name="//apple_ref/cpp/econst/QNetworkRequest/SetCookieHeader" />
84
116
<h3 class="fn"><a name="KnownHeaders-enum"></a>enum QNetworkRequest::KnownHeaders</h3>
85
117
<p>List of known header types that <a href="qnetworkrequest.html">QNetworkRequest</a> parses. Each known header is also represented in raw form with its full HTTP name.</p>
86
 
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
 
118
<p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%">
87
119
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
88
120
<tr><td valign="top"><tt>QNetworkRequest::ContentTypeHeader</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">corresponds to the HTTP Content-Type header and contains a string containing the media (MIME) type and any auxiliary data (for instance, charset)</td></tr>
89
121
<tr><td valign="top"><tt>QNetworkRequest::ContentLengthHeader</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">corresponds to the HTTP Content-Length header and contains the length in bytes of the data transmitted.</td></tr>
95
127
<p>See also <a href="qnetworkrequest.html#header">header</a>(), <a href="qnetworkrequest.html#setHeader">setHeader</a>(), <a href="qnetworkrequest.html#rawHeader">rawHeader</a>(), and <a href="qnetworkrequest.html#setRawHeader">setRawHeader</a>().</p>
96
128
<hr />
97
129
<h2>Member Function Documentation</h2>
 
130
<a name="//apple_ref/cpp/instm/QNetworkRequest/QNetworkRequest" />
98
131
<h3 class="fn"><a name="QNetworkRequest"></a>QNetworkRequest::QNetworkRequest ( const <a href="qurl.html">QUrl</a> &amp; <i>url</i> = QUrl() )</h3>
99
132
<p>Constructs a <a href="qnetworkrequest.html">QNetworkRequest</a> object with <i>url</i> as the URL to be requested.</p>
100
133
<p>See also <a href="qnetworkrequest.html#url">url</a>() and <a href="qnetworkrequest.html#setUrl">setUrl</a>().</p>
101
134
<h3 class="fn"><a name="QNetworkRequest-2"></a>QNetworkRequest::QNetworkRequest ( const QNetworkRequest &amp; <i>other</i> )</h3>
102
135
<p>Creates a copy of <i>other</i>.</p>
 
136
<a name="//apple_ref/cpp/instm/QNetworkRequest/~QNetworkRequest" />
103
137
<h3 class="fn"><a name="dtor.QNetworkRequest"></a>QNetworkRequest::~QNetworkRequest ()</h3>
104
138
<p>Disposes of the <a href="qnetworkrequest.html">QNetworkRequest</a> object.</p>
 
139
<a name="//apple_ref/cpp/instm/QNetworkRequest/attribute" />
105
140
<h3 class="fn"><a name="attribute"></a><a href="qvariant.html">QVariant</a> QNetworkRequest::attribute ( <a href="qnetworkrequest.html#Attribute-enum">Attribute</a> <i>code</i>, const <a href="qvariant.html">QVariant</a> &amp; <i>defaultValue</i> = QVariant() ) const</h3>
106
141
<p>Returns the attribute associated with the code <i>code</i>. If the attribute has not been set, it returns <i>defaultValue</i>.</p>
107
142
<p>Note: this function does not apply the defaults listed in <a href="qnetworkrequest.html#Attribute-enum">QNetworkRequest::Attribute</a>.</p>
108
143
<p>See also <a href="qnetworkrequest.html#setAttribute">setAttribute</a>() and <a href="qnetworkrequest.html#Attribute-enum">QNetworkRequest::Attribute</a>.</p>
 
144
<a name="//apple_ref/cpp/instm/QNetworkRequest/hasRawHeader" />
109
145
<h3 class="fn"><a name="hasRawHeader"></a>bool QNetworkRequest::hasRawHeader ( const <a href="qbytearray.html">QByteArray</a> &amp; <i>headerName</i> ) const</h3>
110
146
<p>Returns true if the raw header <i>headerName</i> is present in this network request.</p>
111
147
<p>See also <a href="qnetworkrequest.html#rawHeader">rawHeader</a>() and <a href="qnetworkrequest.html#setRawHeader">setRawHeader</a>().</p>
 
148
<a name="//apple_ref/cpp/instm/QNetworkRequest/header" />
112
149
<h3 class="fn"><a name="header"></a><a href="qvariant.html">QVariant</a> QNetworkRequest::header ( <a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a> <i>header</i> ) const</h3>
113
150
<p>Returns the value of the known network header <i>header</i> if it is present in this request. If it is not present, returns QVariant() (i.e&#x2e;, an invalid variant).</p>
114
151
<p>See also <a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a>, <a href="qnetworkrequest.html#rawHeader">rawHeader</a>(), and <a href="qnetworkrequest.html#setHeader">setHeader</a>().</p>
 
152
<a name="//apple_ref/cpp/instm/QNetworkRequest/rawHeader" />
115
153
<h3 class="fn"><a name="rawHeader"></a><a href="qbytearray.html">QByteArray</a> QNetworkRequest::rawHeader ( const <a href="qbytearray.html">QByteArray</a> &amp; <i>headerName</i> ) const</h3>
116
154
<p>Returns the raw form of header <i>headerName</i>. If no such header is present, an empty <a href="qbytearray.html">QByteArray</a> is returned, which may be indistinguishable from a header that is present but has no content (use <a href="qnetworkrequest.html#hasRawHeader">hasRawHeader</a>() to find out if the header exists or not).</p>
117
155
<p>Raw headers can be set with <a href="qnetworkrequest.html#setRawHeader">setRawHeader</a>() or with <a href="qnetworkrequest.html#setHeader">setHeader</a>().</p>
118
156
<p>See also <a href="qnetworkrequest.html#header">header</a>() and <a href="qnetworkrequest.html#setRawHeader">setRawHeader</a>().</p>
 
157
<a name="//apple_ref/cpp/instm/QNetworkRequest/rawHeaderList" />
119
158
<h3 class="fn"><a name="rawHeaderList"></a><a href="qlist.html">QList</a>&lt;<a href="qbytearray.html">QByteArray</a>&gt; QNetworkRequest::rawHeaderList () const</h3>
120
159
<p>Returns a list of all raw headers that are set in this network request. The list is in the order that the headers were set.</p>
121
160
<p>See also <a href="qnetworkrequest.html#hasRawHeader">hasRawHeader</a>() and <a href="qnetworkrequest.html#rawHeader">rawHeader</a>().</p>
 
161
<a name="//apple_ref/cpp/instm/QNetworkRequest/setAttribute" />
122
162
<h3 class="fn"><a name="setAttribute"></a>void QNetworkRequest::setAttribute ( <a href="qnetworkrequest.html#Attribute-enum">Attribute</a> <i>code</i>, const <a href="qvariant.html">QVariant</a> &amp; <i>value</i> )</h3>
123
163
<p>Sets the attribute associated with code <i>code</i> to be value <i>value</i>. If the attribute is already set, the previous value is discarded. In special, if <i>value</i> is an invalid <a href="qvariant.html">QVariant</a>, the attribute is unset.</p>
124
164
<p>See also <a href="qnetworkrequest.html#attribute">attribute</a>() and <a href="qnetworkrequest.html#Attribute-enum">QNetworkRequest::Attribute</a>.</p>
 
165
<a name="//apple_ref/cpp/instm/QNetworkRequest/setHeader" />
125
166
<h3 class="fn"><a name="setHeader"></a>void QNetworkRequest::setHeader ( <a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a> <i>header</i>, const <a href="qvariant.html">QVariant</a> &amp; <i>value</i> )</h3>
126
167
<p>Sets the value of the known header <i>header</i> to be <i>value</i>, overriding any previously set headers. This operation also sets the equivalent raw HTTP header.</p>
127
168
<p>See also <a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a>, <a href="qnetworkrequest.html#setRawHeader">setRawHeader</a>(), and <a href="qnetworkrequest.html#header">header</a>().</p>
 
169
<a name="//apple_ref/cpp/instm/QNetworkRequest/setRawHeader" />
128
170
<h3 class="fn"><a name="setRawHeader"></a>void QNetworkRequest::setRawHeader ( const <a href="qbytearray.html">QByteArray</a> &amp; <i>headerName</i>, const <a href="qbytearray.html">QByteArray</a> &amp; <i>headerValue</i> )</h3>
129
171
<p>Sets the header <i>headerName</i> to be of value <i>headerValue</i>. If <i>headerName</i> corresponds to a known header (see <a href="qnetworkrequest.html#KnownHeaders-enum">QNetworkRequest::KnownHeaders</a>), the raw format will be parsed and the corresponding &quot;cooked&quot; header will be set as well.</p>
130
172
<p>For example:</p>
132
174
<p>will also set the known header <a href="qnetworkrequest.html#KnownHeaders-enum">LastModifiedHeader</a> to be the <a href="qdatetime.html">QDateTime</a> object of the parsed date.</p>
133
175
<p>Note: setting the same header twice overrides the previous setting. To accomplish the behaviour of multiple HTTP headers of the same name, you should concatenate the two values, separating them with a comma (&quot;,&quot;) and set one single raw header.</p>
134
176
<p>See also <a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a>, <a href="qnetworkrequest.html#setHeader">setHeader</a>(), <a href="qnetworkrequest.html#hasRawHeader">hasRawHeader</a>(), and <a href="qnetworkrequest.html#rawHeader">rawHeader</a>().</p>
 
177
<a name="//apple_ref/cpp/instm/QNetworkRequest/setSslConfiguration" />
135
178
<h3 class="fn"><a name="setSslConfiguration"></a>void QNetworkRequest::setSslConfiguration ( const <a href="qsslconfiguration.html">QSslConfiguration</a> &amp; <i>config</i> )</h3>
136
179
<p>Sets this network request's SSL configuration to be <i>config</i>. The settings that apply are the private key, the local certificate, the SSL protocol (SSLv2, SSLv3, TLSv1 where applicable) and the ciphers that the SSL backend is allowed to use.</p>
137
180
<p>By default, no SSL configuration is set, which allows the backends to choose freely what configuration is best for them.</p>
138
181
<p>See also <a href="qnetworkrequest.html#sslConfiguration">sslConfiguration</a>() and <a href="qsslconfiguration.html#defaultConfiguration">QSslConfiguration::defaultConfiguration</a>().</p>
 
182
<a name="//apple_ref/cpp/instm/QNetworkRequest/setUrl" />
139
183
<h3 class="fn"><a name="setUrl"></a>void QNetworkRequest::setUrl ( const <a href="qurl.html">QUrl</a> &amp; <i>url</i> )</h3>
140
184
<p>Sets the URL this network request is referring to to be <i>url</i>.</p>
141
185
<p>See also <a href="qnetworkrequest.html#url">url</a>().</p>
 
186
<a name="//apple_ref/cpp/instm/QNetworkRequest/sslConfiguration" />
142
187
<h3 class="fn"><a name="sslConfiguration"></a><a href="qsslconfiguration.html">QSslConfiguration</a> QNetworkRequest::sslConfiguration () const</h3>
143
188
<p>Returns this network request's SSL configuration. By default, no SSL settings are specified.</p>
144
189
<p>See also <a href="qnetworkrequest.html#setSslConfiguration">setSslConfiguration</a>().</p>
 
190
<a name="//apple_ref/cpp/instm/QNetworkRequest/url" />
145
191
<h3 class="fn"><a name="url"></a><a href="qurl.html">QUrl</a> QNetworkRequest::url () const</h3>
146
192
<p>Returns the URL this network request is referring to.</p>
147
193
<p>See also <a href="qnetworkrequest.html#setUrl">setUrl</a>().</p>
 
194
<a name="//apple_ref/cpp/instm/QNetworkRequest/operator!=" />
148
195
<h3 class="fn"><a name="operator-not-eq"></a>bool QNetworkRequest::operator!= ( const QNetworkRequest &amp; <i>other</i> ) const</h3>
149
196
<p>Returns false if this object is not the same as <i>other</i>.</p>
150
197
<p>See also <a href="qnetworkrequest.html#operator-eq-eq">operator==</a>().</p>
 
198
<a name="//apple_ref/cpp/instm/QNetworkRequest/operator=" />
151
199
<h3 class="fn"><a name="operator-eq"></a>QNetworkRequest &amp; QNetworkRequest::operator= ( const QNetworkRequest &amp; <i>other</i> )</h3>
152
200
<p>Creates a copy of <i>other</i></p>
 
201
<a name="//apple_ref/cpp/instm/QNetworkRequest/operator==" />
153
202
<h3 class="fn"><a name="operator-eq-eq"></a>bool QNetworkRequest::operator== ( const QNetworkRequest &amp; <i>other</i> ) const</h3>
154
203
<p>Returns true if this object is the same as <i>other</i> (i.e&#x2e;, if they have the same URL, same headers and same meta-data settings).</p>
155
204
<p>See also <a href="qnetworkrequest.html#operator-not-eq">operator!=</a>().</p>
156
205
<p /><address><hr /><div align="center">
157
206
<table width="100%" cellspacing="0" border="0"><tr class="address">
158
 
<td width="30%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
159
 
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
160
 
<td width="30%" align="right"><div align="right">Qt 4.5.2</div></td>
161
 
</tr></table></div></address></body>
 
207
<td width="40%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
 
208
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
209
<td width="40%" align="right"><div align="right">Qt 4.6.0</div></td>
 
210
<script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script><script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script><script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script></tr></table></div></address></body>
162
211
</html>