1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qnetworkrequest.cpp -->
<title>Qt 4.8: QNetworkRequest Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtnetwork.html">QtNetwork</a></li>
<li>QNetworkRequest</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QNetworkRequest Class Reference</h1>
<!-- $$$QNetworkRequest-brief -->
<p>The QNetworkRequest class holds a request to be sent with <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>. <a href="#details">More...</a></p>
<!-- @@@QNetworkRequest -->
<pre class="cpp"> <span class="preprocessor">#include <QNetworkRequest></span></pre><p>This class was introduced in Qt 4.4.</p>
<ul>
<li><a href="qnetworkrequest-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#Attribute-enum">Attribute</a></b> { HttpStatusCodeAttribute, HttpReasonPhraseAttribute, RedirectionTargetAttribute, ConnectionEncryptedAttribute, ..., UserMax }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#CacheLoadControl-enum">CacheLoadControl</a></b> { AlwaysNetwork, PreferNetwork, PreferCache, AlwaysCache }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a></b> { ContentTypeHeader, ContentLengthHeader, LocationHeader, LastModifiedHeader, CookieHeader, SetCookieHeader }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#LoadControl-enum">LoadControl</a></b> { Automatic, Manual }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#Priority-enum">Priority</a></b> { HighPriority, NormalPriority, LowPriority }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#QNetworkRequest">QNetworkRequest</a></b> ( const QUrl & <i>url</i> = QUrl() )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#QNetworkRequest-2">QNetworkRequest</a></b> ( const QNetworkRequest & <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#dtor.QNetworkRequest">~QNetworkRequest</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#attribute">attribute</a></b> ( Attribute <i>code</i>, const QVariant & <i>defaultValue</i> = QVariant() ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#hasRawHeader">hasRawHeader</a></b> ( const QByteArray & <i>headerName</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#header">header</a></b> ( KnownHeaders <i>header</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QObject * </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#originatingObject">originatingObject</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Priority </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#priority">priority</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#rawHeader">rawHeader</a></b> ( const QByteArray & <i>headerName</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList<QByteArray> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#rawHeaderList">rawHeaderList</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#setAttribute">setAttribute</a></b> ( Attribute <i>code</i>, const QVariant & <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#setHeader">setHeader</a></b> ( KnownHeaders <i>header</i>, const QVariant & <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#setOriginatingObject">setOriginatingObject</a></b> ( QObject * <i>object</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#setPriority">setPriority</a></b> ( Priority <i>priority</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#setRawHeader">setRawHeader</a></b> ( const QByteArray & <i>headerName</i>, const QByteArray & <i>headerValue</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#setSslConfiguration">setSslConfiguration</a></b> ( const QSslConfiguration & <i>config</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#setUrl">setUrl</a></b> ( const QUrl & <i>url</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSslConfiguration </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#sslConfiguration">sslConfiguration</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#url">url</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#operator-not-eq">operator!=</a></b> ( const QNetworkRequest & <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkRequest & </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#operator-eq">operator=</a></b> ( const QNetworkRequest & <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkrequest.html#operator-eq-eq">operator==</a></b> ( const QNetworkRequest & <i>other</i> ) const</td></tr>
</table>
<a name="details"></a>
<!-- $$$QNetworkRequest-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QNetworkRequest class holds a request to be sent with <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>.</p>
<p>QNetworkRequest is part of the Network Access API and is the class holding the information necessary to send a request over the network. It contains a URL and some ancillary information that can be used to modify the request.</p>
</div>
<p><b>See also </b><a href="qnetworkreply.html">QNetworkReply</a> and <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>.</p>
<!-- @@@QNetworkRequest -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Attribute$$$HttpStatusCodeAttribute$$$HttpReasonPhraseAttribute$$$RedirectionTargetAttribute$$$ConnectionEncryptedAttribute$$$CacheLoadControlAttribute$$$CacheSaveControlAttribute$$$SourceIsFromCacheAttribute$$$DoNotBufferUploadDataAttribute$$$HttpPipeliningAllowedAttribute$$$HttpPipeliningWasUsedAttribute$$$CustomVerbAttribute$$$CookieLoadControlAttribute$$$AuthenticationReuseAttribute$$$CookieSaveControlAttribute$$$MaximumDownloadBufferSizeAttribute$$$DownloadBufferAttribute$$$SynchronousRequestAttribute$$$User$$$UserMax -->
<h3 class="fn"><a name="Attribute-enum"></a>enum QNetworkRequest::<span class="name">Attribute</span></h3>
<p>Attribute codes for the <a href="qnetworkrequest.html">QNetworkRequest</a> and <a href="qnetworkreply.html">QNetworkReply</a>.</p>
<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>
<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>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::HttpStatusCodeAttribute</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">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.). If the connection was not HTTP-based, this attribute will not be present.</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::HttpReasonPhraseAttribute</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">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 "Ok", "Found", "Not Found", "Access Denied", 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>
<tr><td class="topAlign"><tt>QNetworkRequest::RedirectionTargetAttribute</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">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. The returned URL might be relative. Use <a href="qurl.html#resolved">QUrl::resolved</a>() to create an absolute URL out of it.</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::ConnectionEncryptedAttribute</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">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>
<tr><td class="topAlign"><tt>QNetworkRequest::CacheLoadControlAttribute</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">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>
<tr><td class="topAlign"><tt>QNetworkRequest::CacheSaveControlAttribute</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">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>
<tr><td class="topAlign"><tt>QNetworkRequest::SourceIsFromCacheAttribute</tt></td><td class="topAlign"><tt>6</tt></td><td class="topAlign">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>
<tr><td class="topAlign"><tt>QNetworkRequest::DoNotBufferUploadDataAttribute</tt></td><td class="topAlign"><tt>7</tt></td><td class="topAlign">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. 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>
<tr><td class="topAlign"><tt>QNetworkRequest::HttpPipeliningAllowedAttribute</tt></td><td class="topAlign"><tt>8</tt></td><td class="topAlign">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>
<tr><td class="topAlign"><tt>QNetworkRequest::HttpPipeliningWasUsedAttribute</tt></td><td class="topAlign"><tt>9</tt></td><td class="topAlign">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>
<tr><td class="topAlign"><tt>QNetworkRequest::CustomVerbAttribute</tt></td><td class="topAlign"><tt>10</tt></td><td class="topAlign">Requests only, type: <a href="qvariant.html#Type-enum">QVariant::ByteArray</a> Holds the value for the custom HTTP verb to send (destined for usage of other verbs than GET, POST, PUT and DELETE). This verb is set when calling <a href="qnetworkaccessmanager.html#sendCustomRequest">QNetworkAccessManager::sendCustomRequest</a>().</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::CookieLoadControlAttribute</tt></td><td class="topAlign"><tt>11</tt></td><td class="topAlign">Requests only, type: <a href="qvariant.html#Type-enum">QVariant::Int</a> (default: <a href="qnetworkrequest.html#LoadControl-enum">QNetworkRequest::Automatic</a>) Indicates whether to send 'Cookie' headers in the request. This attribute is set to false by <a href="qtwebkit.html">QtWebKit</a> when creating a cross-origin <a href="qdeclarativeglobalobject.html#xmlhttprequest">XMLHttpRequest</a> where withCredentials has not been set explicitly to true by the Javascript that created the request. See <a href="http://www.w3.org/TR/XMLHttpRequest2/#credentials-flag">here</a> for more information. (This value was introduced in 4.7.)</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::CookieSaveControlAttribute</tt></td><td class="topAlign"><tt>13</tt></td><td class="topAlign">Requests only, type: <a href="qvariant.html#Type-enum">QVariant::Int</a> (default: <a href="qnetworkrequest.html#LoadControl-enum">QNetworkRequest::Automatic</a>) Indicates whether to save 'Cookie' headers received from the server in reply to the request. This attribute is set to false by <a href="qtwebkit.html">QtWebKit</a> when creating a cross-origin <a href="qdeclarativeglobalobject.html#xmlhttprequest">XMLHttpRequest</a> where withCredentials has not been set explicitly to true by the Javascript that created the request. See <a href="http://www.w3.org/TR/XMLHttpRequest2/#credentials-flag">here</a> for more information. (This value was introduced in 4.7.)</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::AuthenticationReuseAttribute</tt></td><td class="topAlign"><tt>12</tt></td><td class="topAlign">Requests only, type: <a href="qvariant.html#Type-enum">QVariant::Int</a> (default: <a href="qnetworkrequest.html#LoadControl-enum">QNetworkRequest::Automatic</a>) Indicates whether to use cached authorization credentials in the request, if available. If this is set to <a href="qnetworkrequest.html#LoadControl-enum">QNetworkRequest::Manual</a> and the authentication mechanism is 'Basic' or 'Digest', Qt will not send an an 'Authorization' HTTP header with any cached credentials it may have for the request's URL. This attribute is set to <a href="qnetworkrequest.html#LoadControl-enum">QNetworkRequest::Manual</a> by <a href="qtwebkit.html">QtWebKit</a> when creating a cross-origin <a href="qdeclarativeglobalobject.html#xmlhttprequest">XMLHttpRequest</a> where withCredentials has not been set explicitly to true by the Javascript that created the request. See <a href="http://www.w3.org/TR/XMLHttpRequest2/#credentials-flag">here</a> for more information. (This value was introduced in 4.7.)</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::User</tt></td><td class="topAlign"><tt>1000</tt></td><td class="topAlign">Special type. Additional information can be passed in <a href="qtwebkit-bridge.html#qvariants">QVariants</a> 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>
<tr><td class="topAlign"><tt>QNetworkRequest::UserMax</tt></td><td class="topAlign"><tt>32767</tt></td><td class="topAlign">Special type. See User.</td></tr>
</table>
<p>This enum was introduced or modified in Qt 4.7.</p>
<!-- @@@Attribute -->
<!-- $$$CacheLoadControl$$$AlwaysNetwork$$$PreferNetwork$$$PreferCache$$$AlwaysCache -->
<h3 class="fn"><a name="CacheLoadControl-enum"></a>enum QNetworkRequest::<span class="name">CacheLoadControl</span></h3>
<p>Controls the caching mechanism of <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::AlwaysNetwork</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">always load from network and do not check if the cache has a valid entry (similar to the "Reload" feature in browsers)</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::PreferNetwork</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">default value; load from the network if the cached entry is older than the network entry</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::PreferCache</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">load from cache if available, otherwise load from network. Note that this can return possibly stale (but not expired) items from cache.</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::AlwaysCache</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">only load from cache, indicating error if the item was not cached (i.e., off-line mode)</td></tr>
</table>
<!-- @@@CacheLoadControl -->
<!-- $$$KnownHeaders$$$ContentTypeHeader$$$ContentLengthHeader$$$LocationHeader$$$LastModifiedHeader$$$CookieHeader$$$SetCookieHeader$$$ContentDispositionHeader -->
<h3 class="fn"><a name="KnownHeaders-enum"></a>enum QNetworkRequest::<span class="name">KnownHeaders</span></h3>
<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>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::ContentTypeHeader</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">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>
<tr><td class="topAlign"><tt>QNetworkRequest::ContentLengthHeader</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">corresponds to the HTTP Content-Length header and contains the length in bytes of the data transmitted.</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::LocationHeader</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">corresponds to the HTTP Location header and contains a URL representing the actual location of the data, including the destination URL in case of redirections.</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::LastModifiedHeader</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">corresponds to the HTTP Last-Modified header and contains a <a href="qdatetime.html">QDateTime</a> representing the last modification date of the contents</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::CookieHeader</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">corresponds to the HTTP Cookie header and contains a <a href="qlist.html">QList</a><<a href="qnetworkcookie.html">QNetworkCookie</a>> representing the cookies to be sent back to the server</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::SetCookieHeader</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">corresponds to the HTTP Set-Cookie header and contains a <a href="qlist.html">QList</a><<a href="qnetworkcookie.html">QNetworkCookie</a>> representing the cookies sent by the server to be stored locally</td></tr>
</table>
<p><b>See also </b><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>
<!-- @@@KnownHeaders -->
<!-- $$$LoadControl$$$Automatic$$$Manual -->
<h3 class="fn"><a name="LoadControl-enum"></a>enum QNetworkRequest::<span class="name">LoadControl</span></h3>
<p>Indicates if an aspect of the request's loading mechanism has been manually overridden, e.g. by <a href="qtwebkit.html">QtWebKit</a>.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::Automatic</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">default value: indicates default behaviour.</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::Manual</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">indicates behaviour has been manually overridden.</td></tr>
</table>
<p>This enum was introduced or modified in Qt 4.7.</p>
<!-- @@@LoadControl -->
<!-- $$$Priority$$$HighPriority$$$NormalPriority$$$LowPriority -->
<h3 class="fn"><a name="Priority-enum"></a>enum QNetworkRequest::<span class="name">Priority</span></h3>
<p>This enum lists the possible network request priorities.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::HighPriority</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">High priority</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::NormalPriority</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">Normal priority</td></tr>
<tr><td class="topAlign"><tt>QNetworkRequest::LowPriority</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">Low priority</td></tr>
</table>
<p>This enum was introduced or modified in Qt 4.7.</p>
<!-- @@@Priority -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QNetworkRequest[overload1]$$$QNetworkRequestconstQUrl& -->
<h3 class="fn"><a name="QNetworkRequest"></a>QNetworkRequest::<span class="name">QNetworkRequest</span> ( const <span class="type"><a href="qurl.html">QUrl</a></span> & <i>url</i> = QUrl() )</h3>
<p>Constructs a <a href="qnetworkrequest.html">QNetworkRequest</a> object with <i>url</i> as the URL to be requested.</p>
<p><b>See also </b><a href="qnetworkrequest.html#url">url</a>() and <a href="qnetworkrequest.html#setUrl">setUrl</a>().</p>
<!-- @@@QNetworkRequest -->
<!-- $$$QNetworkRequest$$$QNetworkRequestconstQNetworkRequest& -->
<h3 class="fn"><a name="QNetworkRequest-2"></a>QNetworkRequest::<span class="name">QNetworkRequest</span> ( const <span class="type">QNetworkRequest</span> & <i>other</i> )</h3>
<p>Creates a copy of <i>other</i>.</p>
<!-- @@@QNetworkRequest -->
<!-- $$$~QNetworkRequest[overload1]$$$~QNetworkRequest -->
<h3 class="fn"><a name="dtor.QNetworkRequest"></a>QNetworkRequest::<span class="name">~QNetworkRequest</span> ()</h3>
<p>Disposes of the <a href="qnetworkrequest.html">QNetworkRequest</a> object.</p>
<!-- @@@~QNetworkRequest -->
<!-- $$$attribute[overload1]$$$attributeAttributeconstQVariant& -->
<h3 class="fn"><a name="attribute"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QNetworkRequest::<span class="name">attribute</span> ( <span class="type"><a href="qnetworkrequest.html#Attribute-enum">Attribute</a></span> <i>code</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>defaultValue</i> = QVariant() ) const</h3>
<p>Returns the attribute associated with the code <i>code</i>. If the attribute has not been set, it returns <i>defaultValue</i>.</p>
<p>Note: this function does not apply the defaults listed in <a href="qnetworkrequest.html#Attribute-enum">QNetworkRequest::Attribute</a>.</p>
<p><b>See also </b><a href="qnetworkrequest.html#setAttribute">setAttribute</a>() and <a href="qnetworkrequest.html#Attribute-enum">QNetworkRequest::Attribute</a>.</p>
<!-- @@@attribute -->
<!-- $$$hasRawHeader[overload1]$$$hasRawHeaderconstQByteArray& -->
<h3 class="fn"><a name="hasRawHeader"></a><span class="type">bool</span> QNetworkRequest::<span class="name">hasRawHeader</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> & <i>headerName</i> ) const</h3>
<p>Returns true if the raw header <i>headerName</i> is present in this network request.</p>
<p><b>See also </b><a href="qnetworkrequest.html#rawHeader">rawHeader</a>() and <a href="qnetworkrequest.html#setRawHeader">setRawHeader</a>().</p>
<!-- @@@hasRawHeader -->
<!-- $$$header[overload1]$$$headerKnownHeaders -->
<h3 class="fn"><a name="header"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QNetworkRequest::<span class="name">header</span> ( <span class="type"><a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a></span> <i>header</i> ) const</h3>
<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., an invalid variant).</p>
<p><b>See also </b><a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a>, <a href="qnetworkrequest.html#rawHeader">rawHeader</a>(), and <a href="qnetworkrequest.html#setHeader">setHeader</a>().</p>
<!-- @@@header -->
<!-- $$$originatingObject[overload1]$$$originatingObject -->
<h3 class="fn"><a name="originatingObject"></a><span class="type"><a href="qobject.html">QObject</a></span> * QNetworkRequest::<span class="name">originatingObject</span> () const</h3>
<p>Returns a reference to the object that initiated this network request; returns 0 if not set or the object has been destroyed.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qnetworkrequest.html#setOriginatingObject">setOriginatingObject</a>().</p>
<!-- @@@originatingObject -->
<!-- $$$priority[overload1]$$$priority -->
<h3 class="fn"><a name="priority"></a><span class="type"><a href="qnetworkrequest.html#Priority-enum">Priority</a></span> QNetworkRequest::<span class="name">priority</span> () const</h3>
<p>Return the priority of this request.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qnetworkrequest.html#setPriority">setPriority</a>().</p>
<!-- @@@priority -->
<!-- $$$rawHeader[overload1]$$$rawHeaderconstQByteArray& -->
<h3 class="fn"><a name="rawHeader"></a><span class="type"><a href="qbytearray.html">QByteArray</a></span> QNetworkRequest::<span class="name">rawHeader</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> & <i>headerName</i> ) const</h3>
<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>
<p>Raw headers can be set with <a href="qnetworkrequest.html#setRawHeader">setRawHeader</a>() or with <a href="qnetworkrequest.html#setHeader">setHeader</a>().</p>
<p><b>See also </b><a href="qnetworkrequest.html#header">header</a>() and <a href="qnetworkrequest.html#setRawHeader">setRawHeader</a>().</p>
<!-- @@@rawHeader -->
<!-- $$$rawHeaderList[overload1]$$$rawHeaderList -->
<h3 class="fn"><a name="rawHeaderList"></a><span class="type"><a href="qlist.html">QList</a></span><<span class="type"><a href="qbytearray.html">QByteArray</a></span>> QNetworkRequest::<span class="name">rawHeaderList</span> () const</h3>
<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>
<p><b>See also </b><a href="qnetworkrequest.html#hasRawHeader">hasRawHeader</a>() and <a href="qnetworkrequest.html#rawHeader">rawHeader</a>().</p>
<!-- @@@rawHeaderList -->
<!-- $$$setAttribute[overload1]$$$setAttributeAttributeconstQVariant& -->
<h3 class="fn"><a name="setAttribute"></a><span class="type">void</span> QNetworkRequest::<span class="name">setAttribute</span> ( <span class="type"><a href="qnetworkrequest.html#Attribute-enum">Attribute</a></span> <i>code</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>value</i> )</h3>
<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>
<p><b>See also </b><a href="qnetworkrequest.html#attribute">attribute</a>() and <a href="qnetworkrequest.html#Attribute-enum">QNetworkRequest::Attribute</a>.</p>
<!-- @@@setAttribute -->
<!-- $$$setHeader[overload1]$$$setHeaderKnownHeadersconstQVariant& -->
<h3 class="fn"><a name="setHeader"></a><span class="type">void</span> QNetworkRequest::<span class="name">setHeader</span> ( <span class="type"><a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a></span> <i>header</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>value</i> )</h3>
<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>
<p><b>See also </b><a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a>, <a href="qnetworkrequest.html#setRawHeader">setRawHeader</a>(), and <a href="qnetworkrequest.html#header">header</a>().</p>
<!-- @@@setHeader -->
<!-- $$$setOriginatingObject[overload1]$$$setOriginatingObjectQObject* -->
<h3 class="fn"><a name="setOriginatingObject"></a><span class="type">void</span> QNetworkRequest::<span class="name">setOriginatingObject</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i> )</h3>
<p>Allows setting a reference to the <i>object</i> initiating the request.</p>
<p>For example <a href="qtwebkit.html">QtWebKit</a> sets the originating object to the <a href="qwebframe.html">QWebFrame</a> that initiated the request.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also </b><a href="qnetworkrequest.html#originatingObject">originatingObject</a>().</p>
<!-- @@@setOriginatingObject -->
<!-- $$$setPriority[overload1]$$$setPriorityPriority -->
<h3 class="fn"><a name="setPriority"></a><span class="type">void</span> QNetworkRequest::<span class="name">setPriority</span> ( <span class="type"><a href="qnetworkrequest.html#Priority-enum">Priority</a></span> <i>priority</i> )</h3>
<p>Set the priority of this request to <i>priority</i>.</p>
<p><b>Note:</b> The <i>priority</i> is only a hint to the network access manager. It can use it or not. Currently it is used for HTTP to decide which request should be sent first to a server.</p>
<p>This function was introduced in Qt 4.7.</p>
<p><b>See also </b><a href="qnetworkrequest.html#priority">priority</a>().</p>
<!-- @@@setPriority -->
<!-- $$$setRawHeader[overload1]$$$setRawHeaderconstQByteArray&constQByteArray& -->
<h3 class="fn"><a name="setRawHeader"></a><span class="type">void</span> QNetworkRequest::<span class="name">setRawHeader</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> & <i>headerName</i>, const <span class="type"><a href="qbytearray.html">QByteArray</a></span> & <i>headerValue</i> )</h3>
<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 "cooked" header will be set as well.</p>
<p>For example:</p>
<pre class="cpp"> request<span class="operator">.</span>setRawHeader(<span class="string">"Last-Modified"</span><span class="operator">,</span> <span class="string">"Sun, 06 Nov 1994 08:49:37 GMT"</span>);</pre>
<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>
<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 (",") and set one single raw header.</p>
<p><b>See also </b><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>
<!-- @@@setRawHeader -->
<!-- $$$setSslConfiguration[overload1]$$$setSslConfigurationconstQSslConfiguration& -->
<h3 class="fn"><a name="setSslConfiguration"></a><span class="type">void</span> QNetworkRequest::<span class="name">setSslConfiguration</span> ( const <span class="type"><a href="qsslconfiguration.html">QSslConfiguration</a></span> & <i>config</i> )</h3>
<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), the CA certificates and the ciphers that the SSL backend is allowed to use.</p>
<p>By default, no SSL configuration is set, which allows the backends to choose freely what configuration is best for them.</p>
<p><b>See also </b><a href="qnetworkrequest.html#sslConfiguration">sslConfiguration</a>() and <a href="qsslconfiguration.html#defaultConfiguration">QSslConfiguration::defaultConfiguration</a>().</p>
<!-- @@@setSslConfiguration -->
<!-- $$$setUrl[overload1]$$$setUrlconstQUrl& -->
<h3 class="fn"><a name="setUrl"></a><span class="type">void</span> QNetworkRequest::<span class="name">setUrl</span> ( const <span class="type"><a href="qurl.html">QUrl</a></span> & <i>url</i> )</h3>
<p>Sets the URL this network request is referring to to be <i>url</i>.</p>
<p><b>See also </b><a href="qnetworkrequest.html#url">url</a>().</p>
<!-- @@@setUrl -->
<!-- $$$sslConfiguration[overload1]$$$sslConfiguration -->
<h3 class="fn"><a name="sslConfiguration"></a><span class="type"><a href="qsslconfiguration.html">QSslConfiguration</a></span> QNetworkRequest::<span class="name">sslConfiguration</span> () const</h3>
<p>Returns this network request's SSL configuration. By default, no SSL settings are specified.</p>
<p><b>See also </b><a href="qnetworkrequest.html#setSslConfiguration">setSslConfiguration</a>().</p>
<!-- @@@sslConfiguration -->
<!-- $$$url[overload1]$$$url -->
<h3 class="fn"><a name="url"></a><span class="type"><a href="qurl.html">QUrl</a></span> QNetworkRequest::<span class="name">url</span> () const</h3>
<p>Returns the URL this network request is referring to.</p>
<p><b>See also </b><a href="qnetworkrequest.html#setUrl">setUrl</a>().</p>
<!-- @@@url -->
<!-- $$$operator!=[overload1]$$$operator!=constQNetworkRequest& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QNetworkRequest::<span class="name">operator!=</span> ( const <span class="type">QNetworkRequest</span> & <i>other</i> ) const</h3>
<p>Returns false if this object is not the same as <i>other</i>.</p>
<p><b>See also </b><a href="qnetworkrequest.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQNetworkRequest& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QNetworkRequest</span> & QNetworkRequest::<span class="name">operator=</span> ( const <span class="type">QNetworkRequest</span> & <i>other</i> )</h3>
<p>Creates a copy of <i>other</i></p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQNetworkRequest& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QNetworkRequest::<span class="name">operator==</span> ( const <span class="type">QNetworkRequest</span> & <i>other</i> ) const</h3>
<p>Returns true if this object is the same as <i>other</i> (i.e., if they have the same URL, same headers and same meta-data settings).</p>
<p><b>See also </b><a href="qnetworkrequest.html#operator-not-eq">operator!=</a>().</p>
<!-- @@@operator== -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|