<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html><head><title>QNetworkRequest Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } td.postheader { font-family: sans-serif } tr.address { font-family: sans-serif } body { background: #ffffff; color: black; } </style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QNetworkRequest Class Reference<br /><sup><sup>[<a href="qtnetwork.html">QtNetwork</a> module]</sup></sup></h1><p>The QNetworkRequest class holds a request to be sent with <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>. <a href="#details">More...</a></p> <h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qnetworkrequest.html#Attribute-enum">Attribute</a></b> { HttpStatusCodeAttribute, HttpReasonPhraseAttribute, RedirectionTargetAttribute, ConnectionEncryptedAttribute, ..., UserMax }</li><li><div class="fn" />enum <b><a href="qnetworkrequest.html#CacheLoadControl-enum">CacheLoadControl</a></b> { AlwaysNetwork, PreferNetwork, PreferCache, AlwaysCache }</li><li><div class="fn" />enum <b><a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a></b> { ContentTypeHeader, ContentLengthHeader, LocationHeader, LastModifiedHeader, ..., ContentDispositionHeader }</li><li><div class="fn" />enum <b><a href="qnetworkrequest.html#LoadControl-enum">LoadControl</a></b> { Automatic, Manual }</li><li><div class="fn" />enum <b><a href="qnetworkrequest.html#Priority-enum">Priority</a></b> { HighPriority, NormalPriority, LowPriority }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qnetworkrequest.html#QNetworkRequest">__init__</a></b> (<i>self</i>, QUrl <i>url</i> = QUrl())</li><li><div class="fn" /><b><a href="qnetworkrequest.html#QNetworkRequest-2">__init__</a></b> (<i>self</i>, QNetworkRequest <i>other</i>)</li><li><div class="fn" />QVariant <b><a href="qnetworkrequest.html#attribute">attribute</a></b> (<i>self</i>, Attribute <i>code</i>, QVariant <i>defaultValue</i> = QVariant())</li><li><div class="fn" />bool <b><a href="qnetworkrequest.html#hasRawHeader">hasRawHeader</a></b> (<i>self</i>, QByteArray <i>headerName</i>)</li><li><div class="fn" />QVariant <b><a href="qnetworkrequest.html#header">header</a></b> (<i>self</i>, KnownHeaders <i>header</i>)</li><li><div class="fn" />QObject <b><a href="qnetworkrequest.html#originatingObject">originatingObject</a></b> (<i>self</i>)</li><li><div class="fn" />Priority <b><a href="qnetworkrequest.html#priority">priority</a></b> (<i>self</i>)</li><li><div class="fn" />QByteArray <b><a href="qnetworkrequest.html#rawHeader">rawHeader</a></b> (<i>self</i>, QByteArray <i>headerName</i>)</li><li><div class="fn" />list-of-QByteArray <b><a href="qnetworkrequest.html#rawHeaderList">rawHeaderList</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setAttribute">setAttribute</a></b> (<i>self</i>, Attribute <i>code</i>, QVariant <i>value</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setHeader">setHeader</a></b> (<i>self</i>, KnownHeaders <i>header</i>, QVariant <i>value</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setOriginatingObject">setOriginatingObject</a></b> (<i>self</i>, QObject <i>object</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setPriority">setPriority</a></b> (<i>self</i>, Priority <i>priority</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setRawHeader">setRawHeader</a></b> (<i>self</i>, QByteArray <i>headerName</i>, QByteArray <i>value</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setSslConfiguration">setSslConfiguration</a></b> (<i>self</i>, QSslConfiguration <i>configuration</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setUrl">setUrl</a></b> (<i>self</i>, QUrl <i>url</i>)</li><li><div class="fn" />QSslConfiguration <b><a href="qnetworkrequest.html#sslConfiguration">sslConfiguration</a></b> (<i>self</i>)</li><li><div class="fn" />QUrl <b><a href="qnetworkrequest.html#url">url</a></b> (<i>self</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qnetworkrequest.html#__eq__">__eq__</a></b> (<i>self</i>, QNetworkRequest <i>other</i>)</li><li><div class="fn" />bool <b><a href="qnetworkrequest.html#__ne__">__ne__</a></b> (<i>self</i>, QNetworkRequest <i>other</i>)</li></ul><a name="details" /><hr /><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> <hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Attribute-enum" />QNetworkRequest.Attribute</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 class="odd" valign="top"> <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> <h3 class="fn"><a name="CacheLoadControl-enum" />QNetworkRequest.CacheLoadControl</h3><p>Controls the caching mechanism of <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>.</p> <table class="valuelist"> <tr class="odd" valign="top"> <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> <h3 class="fn"><a name="KnownHeaders-enum" />QNetworkRequest.KnownHeaders</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 class="odd" valign="top"> <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> <h3 class="fn"><a name="LoadControl-enum" />QNetworkRequest.LoadControl</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 class="odd" valign="top"> <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> <h3 class="fn"><a name="Priority-enum" />QNetworkRequest.Priority</h3><p>This enum lists the possible network request priorities.</p> <table class="valuelist"> <tr class="odd" valign="top"> <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> <hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QNetworkRequest" />QNetworkRequest.__init__ (<i>self</i>, <a href="qurl.html">QUrl</a> <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> <h3 class="fn"><a name="QNetworkRequest-2" />QNetworkRequest.__init__ (<i>self</i>, <a href="qnetworkrequest.html">QNetworkRequest</a> <i>other</i>)</h3><p>Creates a copy of <i>other</i>.</p> <h3 class="fn"><a name="attribute" />QVariant QNetworkRequest.attribute (<i>self</i>, <a href="qnetworkrequest.html#Attribute-enum">Attribute</a> <i>code</i>, QVariant <i>defaultValue</i> = QVariant())</h3><h3 class="fn"><a name="hasRawHeader" />bool QNetworkRequest.hasRawHeader (<i>self</i>, <a href="qbytearray.html">QByteArray</a> <i>headerName</i>)</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> <h3 class="fn"><a name="header" />QVariant QNetworkRequest.header (<i>self</i>, <a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a> <i>header</i>)</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> <h3 class="fn"><a name="originatingObject" /><a href="qobject.html">QObject</a> QNetworkRequest.originatingObject (<i>self</i>)</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> <h3 class="fn"><a name="priority" /><a href="qnetworkrequest.html#Priority-enum">Priority</a> QNetworkRequest.priority (<i>self</i>)</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> <h3 class="fn"><a name="rawHeader" /><a href="qbytearray.html">QByteArray</a> QNetworkRequest.rawHeader (<i>self</i>, <a href="qbytearray.html">QByteArray</a> <i>headerName</i>)</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> <h3 class="fn"><a name="rawHeaderList" />list-of-QByteArray QNetworkRequest.rawHeaderList (<i>self</i>)</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> <h3 class="fn"><a name="setAttribute" />QNetworkRequest.setAttribute (<i>self</i>, <a href="qnetworkrequest.html#Attribute-enum">Attribute</a> <i>code</i>, QVariant <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#attributex">attribute</a>() and <a href="qnetworkrequest.html#Attribute-enum">QNetworkRequest.Attribute</a>.</p> <h3 class="fn"><a name="setHeader" />QNetworkRequest.setHeader (<i>self</i>, <a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a> <i>header</i>, QVariant <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> <h3 class="fn"><a name="setOriginatingObject" />QNetworkRequest.setOriginatingObject (<i>self</i>, <a href="qobject.html">QObject</a> <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> <h3 class="fn"><a name="setPriority" />QNetworkRequest.setPriority (<i>self</i>, <a href="qnetworkrequest.html#Priority-enum">Priority</a> <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> <h3 class="fn"><a name="setRawHeader" />QNetworkRequest.setRawHeader (<i>self</i>, <a href="qbytearray.html">QByteArray</a> <i>headerName</i>, <a href="qbytearray.html">QByteArray</a> <i>value</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> <h3 class="fn"><a name="setSslConfiguration" />QNetworkRequest.setSslConfiguration (<i>self</i>, <a href="qsslconfiguration.html">QSslConfiguration</a> <i>configuration</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> <h3 class="fn"><a name="setUrl" />QNetworkRequest.setUrl (<i>self</i>, <a href="qurl.html">QUrl</a> <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> <h3 class="fn"><a name="sslConfiguration" /><a href="qsslconfiguration.html">QSslConfiguration</a> QNetworkRequest.sslConfiguration (<i>self</i>)</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> <h3 class="fn"><a name="url" /><a href="qurl.html">QUrl</a> QNetworkRequest.url (<i>self</i>)</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> <h3 class="fn"><a name="__eq__" />bool QNetworkRequest.__eq__ (<i>self</i>, <a href="qnetworkrequest.html">QNetworkRequest</a> <i>other</i>)</h3><h3 class="fn"><a name="__ne__" />bool QNetworkRequest.__ne__ (<i>self</i>, <a href="qnetworkrequest.html">QNetworkRequest</a> <i>other</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.10.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>