File: qnetworkrequest.html

package info (click to toggle)
python-qt4 4.12.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 40,300 kB
  • ctags: 6,185
  • sloc: python: 125,988; cpp: 13,291; xml: 292; makefile: 246; php: 27; sh: 2
file content (465 lines) | stat: -rw-r--r-- 30,845 bytes parent folder | download
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
<?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">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <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&#160;<i>url</i>&#160;=&#160;QUrl())</li><li><div class="fn" /><b><a href="qnetworkrequest.html#QNetworkRequest-2">__init__</a></b> (<i>self</i>, QNetworkRequest&#160;<i>other</i>)</li><li><div class="fn" />QVariant <b><a href="qnetworkrequest.html#attribute">attribute</a></b> (<i>self</i>, Attribute&#160;<i>code</i>, QVariant&#160;<i>defaultValue</i>&#160;=&#160;None)</li><li><div class="fn" />bool <b><a href="qnetworkrequest.html#hasRawHeader">hasRawHeader</a></b> (<i>self</i>, QByteArray&#160;<i>headerName</i>)</li><li><div class="fn" />QVariant <b><a href="qnetworkrequest.html#header">header</a></b> (<i>self</i>, KnownHeaders&#160;<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&#160;<i>headerName</i>)</li><li><div class="fn" />unknown-type <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&#160;<i>code</i>, QVariant&#160;<i>value</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setHeader">setHeader</a></b> (<i>self</i>, KnownHeaders&#160;<i>header</i>, QVariant&#160;<i>value</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setOriginatingObject">setOriginatingObject</a></b> (<i>self</i>, QObject&#160;<i>object</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setPriority">setPriority</a></b> (<i>self</i>, Priority&#160;<i>priority</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setRawHeader">setRawHeader</a></b> (<i>self</i>, QByteArray&#160;<i>headerName</i>, QByteArray&#160;<i>value</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setSslConfiguration">setSslConfiguration</a></b> (<i>self</i>, QSslConfiguration&#160;<i>configuration</i>)</li><li><div class="fn" /><b><a href="qnetworkrequest.html#setUrl">setUrl</a></b> (<i>self</i>, QUrl&#160;<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&#160;<i>other</i>)</li><li><div class="fn" />bool <b><a href="qnetworkrequest.html#__ne__">__ne__</a></b> (<i>self</i>, QNetworkRequest&#160;<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>&lt;<a href="qnetworkcookie.html">QNetworkCookie</a>&gt; 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>&lt;<a href="qnetworkcookie.html">QNetworkCookie</a>&gt; 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>&#160;<i>url</i>&#160;=&#160;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>&#160;<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>&#160;<i>code</i>, QVariant&#160;<i>defaultValue</i>&#160;=&#160;None)</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>


<h3 class="fn"><a name="hasRawHeader" />bool QNetworkRequest.hasRawHeader (<i>self</i>, <a href="qbytearray.html">QByteArray</a>&#160;<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>&#160;<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>&#160;<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" />unknown-type 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>&#160;<i>code</i>, QVariant&#160;<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>


<h3 class="fn"><a name="setHeader" />QNetworkRequest.setHeader (<i>self</i>, <a href="qnetworkrequest.html#KnownHeaders-enum">KnownHeaders</a>&#160;<i>header</i>, QVariant&#160;<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>&#160;<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>&#160;<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>&#160;<i>headerName</i>, <a href="qbytearray.html">QByteArray</a>&#160;<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>&#160;<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>&#160;<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>&#160;<i>other</i>)</h3><h3 class="fn"><a name="__ne__" />bool QNetworkRequest.__ne__ (<i>self</i>, <a href="qnetworkrequest.html">QNetworkRequest</a>&#160;<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&#160;4.12.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt&#160;4.8.7</td></tr></table></div></address></body></html>