-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathreference_http_response.html
More file actions
498 lines (469 loc) · 45 KB
/
reference_http_response.html
File metadata and controls
498 lines (469 loc) · 45 KB
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
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTTP Response — cpp-netlib v0.9 documentation</title>
<link rel="stylesheet" href="_static/cpp-netlib.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.9',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="cpp-netlib v0.9 documentation" href="index.html" />
<link rel="up" title="Reference Manual" href="reference.html" />
<link rel="next" title="HTTP Server API" href="reference_http_server.html" />
<link rel="prev" title="HTTP Request" href="reference_http_request.html" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19815738-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div class="document">
<div id="custom-doc" class="yui-t4">
<div id="hd">
<h1><a href="index.html">cpp-netlib v0.9 documentation</a></h1>
<div class="nav">
« <a href="reference_http_request.html" title="HTTP Request">previous</a>
|
<a href="reference.html" title="Reference Manual" accesskey="U">up</a>
|
<a href="reference_http_server.html" title="HTTP Server API">next</a> »</div>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-g" id="reference_http_response">
<div class="section" id="http-response">
<h1>HTTP Response<a class="headerlink" href="#http-response" title="Permalink to this headline">¶</a></h1>
<p>This part of the documentation talks about the publicly accessible API of the
HTTP Response objects. This section details the <a class="reference internal" href="#response-concept">Response Concept</a> requirements,
the implemented and required <a class="reference internal" href="#directives">Directives</a>, <a class="reference internal" href="#modifiers">Modifiers</a>, and <a class="reference internal" href="#wrappers">Wrappers</a> that work
with the HTTP Response objects.</p>
<div class="section" id="response-concept">
<h2>Response Concept<a class="headerlink" href="#response-concept" title="Permalink to this headline">¶</a></h2>
<p>A type models the Response Concept if it models the <a class="reference external" href="message.html#message-concept">Message Concept</a> and also
supports the following constructs.</p>
<p><strong>Legend</strong></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">R:</th><td class="field-body">The response type.</td>
</tr>
<tr class="field"><th class="field-name">r:</th><td class="field-body">An instance of R.</td>
</tr>
<tr class="field"><th class="field-name">S:</th><td class="field-body">The string type.</td>
</tr>
<tr class="field"><th class="field-name">s,e,g:</th><td class="field-body">Instances of S.</td>
</tr>
<tr class="field"><th class="field-name">P:</th><td class="field-body">The port type.</td>
</tr>
<tr class="field"><th class="field-name">p:</th><td class="field-body">An instance of P.</td>
</tr>
<tr class="field"><th class="field-name">V:</th><td class="field-body">The version type.</td>
</tr>
<tr class="field"><th class="field-name">v:</th><td class="field-body">An instance of v.</td>
</tr>
<tr class="field"><th class="field-name">T:</th><td class="field-body">The status type.</td>
</tr>
<tr class="field"><th class="field-name">t:</th><td class="field-body">An instance of T.</td>
</tr>
<tr class="field"><th class="field-name">M:</th><td class="field-body">The status message type.</td>
</tr>
<tr class="field"><th class="field-name">m:</th><td class="field-body">An instance of M.</td>
</tr>
<tr class="field"><th class="field-name">U:</th><td class="field-body">An unsigned 16-bit int.</td>
</tr>
<tr class="field"><th class="field-name">u:</th><td class="field-body">An instance of U.</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">In the table below, the namespace <tt class="docutils literal"><span class="pre">traits</span></tt> is an alias for
<tt class="docutils literal"><span class="pre">boost::network::http::traits</span></tt>.</p>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="49%" />
<col width="13%" />
<col width="38%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Construct</th>
<th class="head">Result</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr><td><tt class="docutils literal"><span class="pre">R::string_type</span></tt></td>
<td><tt class="docutils literal"><span class="pre">S</span></tt></td>
<td>The nested <tt class="docutils literal"><span class="pre">string_type</span></tt>
type.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">traits::version<R>::type</span></tt></td>
<td><tt class="docutils literal"><span class="pre">V</span></tt></td>
<td>The version type associated
with R.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">traits::status<R>::type</span></tt></td>
<td><tt class="docutils literal"><span class="pre">T</span></tt></td>
<td>The status type associated
with R.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">traits::status_message<R>::type</span></tt></td>
<td><tt class="docutils literal"><span class="pre">M</span></tt></td>
<td>The status message type
associated with R.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">r</span> <span class="pre"><<</span> <span class="pre">version(v)</span></tt></td>
<td><tt class="docutils literal"><span class="pre">R&</span></tt></td>
<td>Sets the version of <tt class="docutils literal"><span class="pre">r</span></tt>.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">r</span> <span class="pre"><<</span> <span class="pre">status(t)</span></tt></td>
<td><tt class="docutils literal"><span class="pre">R&</span></tt></td>
<td>Sets the status of <tt class="docutils literal"><span class="pre">r</span></tt>.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">r</span> <span class="pre"><<</span> <span class="pre">status_message(m)</span></tt></td>
<td><tt class="docutils literal"><span class="pre">R&</span></tt></td>
<td>Sets the status message of
<tt class="docutils literal"><span class="pre">r</span></tt>.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">version(r,</span> <span class="pre">v)</span></tt></td>
<td><tt class="docutils literal"><span class="pre">void</span></tt></td>
<td>Sets the version of <tt class="docutils literal"><span class="pre">r</span></tt>.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">status(r,</span> <span class="pre">t)</span></tt></td>
<td><tt class="docutils literal"><span class="pre">void</span></tt></td>
<td>Sets the status of <tt class="docutils literal"><span class="pre">r</span></tt>.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">status_message(r,</span> <span class="pre">m)</span></tt></td>
<td><tt class="docutils literal"><span class="pre">void</span></tt></td>
<td>Sets the status message of
<tt class="docutils literal"><span class="pre">r</span></tt>.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">S</span> <span class="pre">e</span> <span class="pre">=</span> <span class="pre">version(r)</span></tt></td>
<td><strong>NA</strong></td>
<td>Get the version of <tt class="docutils literal"><span class="pre">r</span></tt>.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">U</span> <span class="pre">u</span> <span class="pre">=</span> <span class="pre">status(r)</span></tt></td>
<td><strong>NA</strong></td>
<td>Get the status of <tt class="docutils literal"><span class="pre">r</span></tt>.</td>
</tr>
<tr><td><tt class="docutils literal"><span class="pre">S</span> <span class="pre">g</span> <span class="pre">=</span> <span class="pre">status_message(r)</span></tt></td>
<td><strong>NA</strong></td>
<td>Get the status message of
<tt class="docutils literal"><span class="pre">r</span></tt>.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="directives">
<h2>Directives<a class="headerlink" href="#directives" title="Permalink to this headline">¶</a></h2>
<p>This section details the provided directives that are provided by
<tt class="xref py py-mod docutils literal"><span class="pre">cpp-netlib</span></tt>. The section was written to assume that an appropriately
constructed response instance is either of the following:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">boost</span><span class="o">::</span><span class="n">network</span><span class="o">::</span><span class="n">http</span><span class="o">::</span><span class="n">basic_response</span><span class="o"><</span>
<span class="n">boost</span><span class="o">::</span><span class="n">network</span><span class="o">::</span><span class="n">http</span><span class="o">::</span><span class="n">tags</span><span class="o">::</span><span class="n">http_default_8bit_udp_resolve</span>
<span class="o">></span> <span class="n">response</span><span class="p">;</span>
<span class="c1">// or</span>
<span class="n">boost</span><span class="o">::</span><span class="n">network</span><span class="o">::</span><span class="n">http</span><span class="o">::</span><span class="n">basic_response</span><span class="o"><</span>
<span class="n">boost</span><span class="o">::</span><span class="n">network</span><span class="o">::</span><span class="n">http</span><span class="o">::</span><span class="n">tags</span><span class="o">::</span><span class="n">http_server</span>
<span class="o">></span> <span class="n">response</span><span class="p">;</span>
</pre></div>
</div>
<p>The section also assumes that there following using namespace declaration is in
effect:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">using</span> <span class="k">namespace</span> <span class="n">boost</span><span class="o">::</span><span class="n">network</span><span class="p">;</span>
</pre></div>
</div>
<p>Directives are meant to be used in the following manner:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="n">response</span> <span class="o"><<</span> <span class="n">directive</span><span class="p">(...);</span>
</pre></div>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p>There are four versions of directives, those that are applicable
to messages that support narrow strings (<tt class="docutils literal"><span class="pre">std::string</span></tt>), those that are
applicable to messages that support wide strings (<tt class="docutils literal"><span class="pre">std::wstring</span></tt>), those
that are applicable to messages that support future-wrapped narrow and wide
strings (<tt class="docutils literal"><span class="pre">boost::shared_future<std::string></span></tt> and
<tt class="docutils literal"><span class="pre">boost::shared_future<std::wstring></span></tt>).</p>
<p>The <tt class="xref py py-mod docutils literal"><span class="pre">cpp-netlib</span></tt> implementation still does not convert wide strings into
UTF-8 encoded narrow strings. This will be implemented in subsequent
library releases.</p>
<p class="last">For now all the implemented directives are listed, even if some of them still
do not implement things correctly.</p>
</div>
<dl class="docutils">
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">source(std::string</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">source_)</span></tt></dt>
<dd>Create a source directive with a <tt class="docutils literal"><span class="pre">std::string</span></tt> as a parameter, to be set
as the source of the response.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">source(std::wstring</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">source_)</span></tt></dt>
<dd>Create a source directive with a <tt class="docutils literal"><span class="pre">std::wstring</span></tt> as a parameter, to be set
as the source of the response.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">source(boost::shared_future<std::string></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">source_)</span></tt></dt>
<dd>Create a source directive with a <tt class="docutils literal"><span class="pre">boost::shared_future<std::string></span></tt> as a parameter, to be set
as the source of the response.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">source(boost::shared_future<std::wstring></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">source_)</span></tt></dt>
<dd>Create a source directive with a <tt class="docutils literal"><span class="pre">boost::shared_future<std::wstring></span></tt> as a parameter, to be set
as the source of the response.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">destination(std::string</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">source_)</span></tt></dt>
<dd>Create a destination directive with a <tt class="docutils literal"><span class="pre">std::string</span></tt> as a parameter, to be
set as the destination of the response.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">destination(std::wstring</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">source_)</span></tt></dt>
<dd>Create a destination directive with a <tt class="docutils literal"><span class="pre">std::wstring</span></tt> as a parameter, to be
set as the destination of the response.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">destination(boost::shared_future<std::string></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">destination_)</span></tt></dt>
<dd>Create a destination directive with a <tt class="docutils literal"><span class="pre">boost::shared_future<std::string></span></tt> as a parameter, to be set
as the destination of the response.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">destination(boost::shared_future<std::wstring></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">destination_)</span></tt></dt>
<dd>Create a destination directive with a <tt class="docutils literal"><span class="pre">boost::shared_future<std::wstring></span></tt> as a parameter, to be set
as the destination of the response.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">header(std::string</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">name,</span> <span class="pre">std::string</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">value)</span></tt></dt>
<dd>Create a header directive that will add the given name and value pair to the
headers already associated with the response. In this case the name and
values are both <tt class="docutils literal"><span class="pre">std::string</span></tt>.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">header(std::wstring</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">name,</span> <span class="pre">std::wstring</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">value)</span></tt></dt>
<dd>Create a header directive that will add the given name and value pair to the
headers already associated with the response. In this case the name and
values are both <tt class="docutils literal"><span class="pre">std::wstring</span></tt>.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">remove_header(std::string</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">name)</span></tt></dt>
<dd>Create a remove_header directive that will remove all the occurences of the
given name from the headers already associated with the response. In this
case the name of the header is of type <tt class="docutils literal"><span class="pre">std::string</span></tt>.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">remove_header(std::wstring</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">name)</span></tt></dt>
<dd>Create a remove_header directive that will remove all the occurences of the
given name from the headers already associated with the response. In this
case the name of the header is of type <tt class="docutils literal"><span class="pre">std::wstring</span></tt>.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">body(std::string</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">body_)</span></tt></dt>
<dd>Create a body directive that will set the response’s body to the given
parameter. In this case the type of the body is an <tt class="docutils literal"><span class="pre">std::string</span></tt>.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">body(std::wstring</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">body_)</span></tt></dt>
<dd>Create a body directive that will set the response’s body to the given
parameter. In this case the type of the body is an <tt class="docutils literal"><span class="pre">std::wstring</span></tt>.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">body(boost::shared_future<std::string></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">body_)</span></tt></dt>
<dd>Create a body directive that will set the response’s body to the given
parameter. In this case the type of the body is an <tt class="docutils literal"><span class="pre">boost::shared_future<std::string></span></tt>.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">body(boost::shared_future<std::wstring></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">body_)</span></tt></dt>
<dd>Create a body directive that will set the response’s body to the given
parameter. In this case the type of the body is an <tt class="docutils literal"><span class="pre">boost::shared_future<std::wstring></span></tt>.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">version(std::string</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">version_)</span></tt></dt>
<dd><p class="first">Create a version directive that will set the response’s version to the given
parameter. In this case the type of the version is an <tt class="docutils literal"><span class="pre">std::string</span></tt>.</p>
<p class="last">Note that this version includes the full <tt class="docutils literal"><span class="pre">"HTTP/"</span></tt> string.</p>
</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">version(std::wstring</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">version_)</span></tt></dt>
<dd><p class="first">Create a version directive that will set the response’s version to the given
parameter. In this case the type of the version is an <tt class="docutils literal"><span class="pre">std::wstring</span></tt>.</p>
<p class="last">Note that this version includes the full <tt class="docutils literal"><span class="pre">"HTTP/"</span></tt> string.</p>
</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">version(boost::shared_future<std::string></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">version_)</span></tt></dt>
<dd><p class="first">Create a version directive that will set the response’s version to the given
parameter. In this case the type of the version is an <tt class="docutils literal"><span class="pre">boost::shared_future<std::string></span></tt>.</p>
<p class="last">Note that this version includes the full <tt class="docutils literal"><span class="pre">"HTTP/"</span></tt> string.</p>
</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">version(boost::shared_future<std::wstring></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">version_)</span></tt></dt>
<dd><p class="first">Create a version directive that will set the response’s version to the given
parameter. In this case the type of the version is an <tt class="docutils literal"><span class="pre">boost::shared_future<std::wstring></span></tt>.</p>
<p class="last">Note that this version includes the full <tt class="docutils literal"><span class="pre">"HTTP/"</span></tt> string.</p>
</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">status_message(std::string</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">status_message_)</span></tt></dt>
<dd><p class="first">Create a status_message directive that will set the response’s status_message to the given
parameter. In this case the type of the status_message is an <tt class="docutils literal"><span class="pre">std::string</span></tt>.</p>
<p class="last">Note that this status_message includes the full <tt class="docutils literal"><span class="pre">"HTTP/"</span></tt> string.</p>
</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">status_message(std::wstring</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">status_message_)</span></tt></dt>
<dd><p class="first">Create a status_message directive that will set the response’s status_message to the given
parameter. In this case the type of the status_message is an <tt class="docutils literal"><span class="pre">std::wstring</span></tt>.</p>
<p class="last">Note that this status_message includes the full <tt class="docutils literal"><span class="pre">"HTTP/"</span></tt> string.</p>
</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">status_message(boost::shared_future<std::string></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">status_message_)</span></tt></dt>
<dd><p class="first">Create a status_message directive that will set the response’s status_message to the given
parameter. In this case the type of the status_message is an <tt class="docutils literal"><span class="pre">boost::shared_future<std::string></span></tt>.</p>
<p class="last">Note that this status_message includes the full <tt class="docutils literal"><span class="pre">"HTTP/"</span></tt> string.</p>
</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">status_message(boost::shared_future<std::wstring></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">status_message_)</span></tt></dt>
<dd><p class="first">Create a status_message directive that will set the response’s status_message to the given
parameter. In this case the type of the status_message is an <tt class="docutils literal"><span class="pre">boost::shared_future<std::wstring></span></tt>.</p>
<p class="last">Note that this status_message includes the full <tt class="docutils literal"><span class="pre">"HTTP/"</span></tt> string.</p>
</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">status(boost::uint16_t</span> <span class="pre">status_)</span></tt></dt>
<dd>Create a status directive that will set the response’s status to the given
parameter. In this case the type of <tt class="docutils literal"><span class="pre">status_</span></tt> is <tt class="docutils literal"><span class="pre">boost::uint16_t</span></tt>.</dd>
<dt><em>unspecified</em> <tt class="docutils literal"><span class="pre">status(boost::shared_future<boost::uint16_t></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">status_)</span></tt></dt>
<dd>Create a status directive that will set the response’s status to the given
parameter. In this case the type of <tt class="docutils literal"><span class="pre">status_</span></tt> is <tt class="docutils literal"><span class="pre">boost::shared_future<boost::uint16_t></span></tt>.</dd>
</dl>
</div>
<div class="section" id="modifiers">
<h2>Modifiers<a class="headerlink" href="#modifiers" title="Permalink to this headline">¶</a></h2>
<p>This section details the provided modifiers that are provided by
<tt class="xref py py-mod docutils literal"><span class="pre">cpp-netlib</span></tt>.</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">source(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">typename</span> <span class="pre">string<Tag>::type</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">source_)</span></tt></dt>
<dd>Modifies the source of the given <tt class="docutils literal"><span class="pre">response</span></tt>. The type of <tt class="docutils literal"><span class="pre">source_</span></tt> is
dependent on the <tt class="docutils literal"><span class="pre">Tag</span></tt> specialization of <tt class="docutils literal"><span class="pre">basic_response</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">source(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">boost::shared_future<typename</span> <span class="pre">string<Tag>::type></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">source_)</span></tt></dt>
<dd>Modifies the source of the given <tt class="docutils literal"><span class="pre">response</span></tt>. The type of <tt class="docutils literal"><span class="pre">source_</span></tt> is
dependent on the <tt class="docutils literal"><span class="pre">Tag</span></tt> specialization of <tt class="docutils literal"><span class="pre">basic_response</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">destination(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">typename</span> <span class="pre">string<Tag>::type</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">destination_)</span></tt></dt>
<dd>Modifies the destination of the given <tt class="docutils literal"><span class="pre">response</span></tt>. The type of <tt class="docutils literal"><span class="pre">destination_</span></tt> is
dependent on the <tt class="docutils literal"><span class="pre">Tag</span></tt> specialization of <tt class="docutils literal"><span class="pre">basic_response</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">destination(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">boost::shared_future<typename</span> <span class="pre">string<Tag>::type></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">destination_)</span></tt></dt>
<dd>Modifies the destination of the given <tt class="docutils literal"><span class="pre">response</span></tt>. The type of <tt class="docutils literal"><span class="pre">destination_</span></tt> is
dependent on the <tt class="docutils literal"><span class="pre">Tag</span></tt> specialization of <tt class="docutils literal"><span class="pre">basic_response</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">add_header(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">typename</span> <span class="pre">string<Tag>::type</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">name,</span> <span class="pre">typename</span> <span class="pre">string<Tag>::type</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">value)</span></tt></dt>
<dd>Adds a header to the given <tt class="docutils literal"><span class="pre">response</span></tt>. The type of the <tt class="docutils literal"><span class="pre">name</span></tt> and
<tt class="docutils literal"><span class="pre">value</span></tt> parameters are dependent on the <tt class="docutils literal"><span class="pre">Tag</span></tt> specialization of
<tt class="docutils literal"><span class="pre">basic_response</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">remove_header(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">typename</span> <span class="pre">string<Tag>::type</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">name)</span></tt></dt>
<dd>Removes a header from the given <tt class="docutils literal"><span class="pre">response</span></tt>. The type of the <tt class="docutils literal"><span class="pre">name</span></tt>
parameter is dependent on the <tt class="docutils literal"><span class="pre">Tag</span></tt> specialization of <tt class="docutils literal"><span class="pre">basic_response</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">headers(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">typename</span> <span class="pre">headers_container<basic_response<Tag></span> <span class="pre">>::type</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">headers_)</span></tt></dt>
<dd>Sets the whole headers contained in <tt class="docutils literal"><span class="pre">response</span></tt> as the given parameter
<tt class="docutils literal"><span class="pre">headers_</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">headers(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">boost::shared_future<typename</span> <span class="pre">headers_container<basic_response<Tag></span> <span class="pre">>::type></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">headers_)</span></tt></dt>
<dd>Sets the whole headers contained in <tt class="docutils literal"><span class="pre">response</span></tt> as the given parameter
<tt class="docutils literal"><span class="pre">headers_</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">clear_headers(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response)</span></tt></dt>
<dd>Removes all headers from the given <tt class="docutils literal"><span class="pre">response</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">body(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">typename</span> <span class="pre">string<Tag>::type</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">body_)</span></tt></dt>
<dd>Modifies the body of the given <tt class="docutils literal"><span class="pre">response</span></tt>. The type of <tt class="docutils literal"><span class="pre">body_</span></tt> is
dependent on the <tt class="docutils literal"><span class="pre">Tag</span></tt> specialization of <tt class="docutils literal"><span class="pre">basic_response</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">body(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">boost::shared_future<typename</span> <span class="pre">string<Tag>::type></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">body_)</span></tt></dt>
<dd>Modifies the body of the given <tt class="docutils literal"><span class="pre">response</span></tt>. The type of <tt class="docutils literal"><span class="pre">body_</span></tt> is
dependent on the <tt class="docutils literal"><span class="pre">Tag</span></tt> specialization of <tt class="docutils literal"><span class="pre">basic_response</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">version(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">typename</span> <span class="pre">traits::version<basic_response<Tag></span> <span class="pre">>::type</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">version_)</span></tt></dt>
<dd>Modifies the version of the given <tt class="docutils literal"><span class="pre">response</span></tt>. The type of <tt class="docutils literal"><span class="pre">version_</span></tt> is
dependent on the <tt class="docutils literal"><span class="pre">Tag</span></tt> specialization of <tt class="docutils literal"><span class="pre">basic_response</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">status(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">typename</span> <span class="pre">traits::status<basic_response<Tag></span> <span class="pre">>::type</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">status_)</span></tt></dt>
<dd>Modifies the status of the given <tt class="docutils literal"><span class="pre">response</span></tt>. The type of <tt class="docutils literal"><span class="pre">status_</span></tt> is
dependent on the <tt class="docutils literal"><span class="pre">Tag</span></tt> specialization of <tt class="docutils literal"><span class="pre">basic_response</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span> <span class="pre">inline</span> <span class="pre">void</span> <span class="pre">status_message(basic_response<Tag></span> <span class="pre">&</span> <span class="pre">response,</span> <span class="pre">typename</span> <span class="pre">traits::status_message<basic_response<Tag></span> <span class="pre">>::type</span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">status_message_)</span></tt></dt>
<dd>Modifies the status message of the given <tt class="docutils literal"><span class="pre">response</span></tt>. The type of <tt class="docutils literal"><span class="pre">status_message_</span></tt> is
dependent on the <tt class="docutils literal"><span class="pre">Tag</span></tt> specialization of <tt class="docutils literal"><span class="pre">basic_response</span></tt>.</dd>
</dl>
</div>
<div class="section" id="wrappers">
<h2>Wrappers<a class="headerlink" href="#wrappers" title="Permalink to this headline">¶</a></h2>
<p>This section details the provided response wrappers that come with
<tt class="xref py py-mod docutils literal"><span class="pre">cpp-netlib</span></tt>. Wrappers are used to convert a message into a different type,
usually providing accessor operations to retrieve just part of the message. This
section assumes that the following using namespace directives are in
effect:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">using</span> <span class="k">namespace</span> <span class="n">boost</span><span class="o">::</span><span class="n">network</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">boost</span><span class="o">::</span><span class="n">network</span><span class="o">::</span><span class="n">http</span><span class="p">;</span>
</pre></div>
</div>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span></tt> <em>unspecified</em> <tt class="docutils literal"><span class="pre">source(basic_response<Tag></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">response)</span></tt></dt>
<dd>Returns a wrapper convertible to <tt class="docutils literal"><span class="pre">typename</span> <span class="pre">string<Tag>::type</span></tt> that
provides the source of a given response.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span></tt> <em>unspecified</em> <tt class="docutils literal"><span class="pre">destination(basic_response<Tag></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">response)</span></tt></dt>
<dd>Returns a wrapper convertible to <tt class="docutils literal"><span class="pre">typename</span> <span class="pre">string<Tag>::type</span></tt> that
provides the destination of a given response.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span></tt> <em>unspecified</em> <tt class="docutils literal"><span class="pre">headers(basic_response<Tag></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">response)</span></tt></dt>
<dd>Returns a wrapper convertible to <tt class="docutils literal"><span class="pre">typename</span> <span class="pre">headers_range<basic_response<Tag></span>
<span class="pre">>::type</span></tt> or <tt class="docutils literal"><span class="pre">typename</span> <span class="pre">basic_response<Tag>::headers_container_type</span></tt> that
provides the headers of a given response.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span></tt> <em>unspecified</em> <tt class="docutils literal"><span class="pre">body(basic_response<Tag></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">response)</span></tt></dt>
<dd>Returns a wrapper convertible to <tt class="docutils literal"><span class="pre">typename</span> <span class="pre">string<Tag>::type</span></tt> that
provides the body of a given response.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span></tt> <em>unspecified</em> <tt class="docutils literal"><span class="pre">version(basic_response<Tag></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">response)</span></tt></dt>
<dd>Returns a wrapper convertible to <tt class="docutils literal"><span class="pre">typename</span> <span class="pre">string<Tag>::type</span></tt> that
provides the version of the given response.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span></tt> <em>unspecified</em> <tt class="docutils literal"><span class="pre">status(basic_response<Tag></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">response)</span></tt></dt>
<dd>Returns a wrapper convertible to <tt class="docutils literal"><span class="pre">typename</span> <span class="pre">string<Tag>::type</span></tt> that
provides the status of the given response.</dd>
<dt><tt class="docutils literal"><span class="pre">template</span> <span class="pre"><class</span> <span class="pre">Tag></span></tt> <em>unspecified</em> <tt class="docutils literal"><span class="pre">status_message(basic_response<Tag></span> <span class="pre">const</span> <span class="pre">&</span> <span class="pre">response)</span></tt></dt>
<dd>Returns a wrapper convertible to <tt class="docutils literal"><span class="pre">typename</span> <span class="pre">string<Tag>::type</span></tt> that
provides the status message of the given response.</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
<div class="yui-b" id="sidebar">
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">HTTP Response</a><ul>
<li><a class="reference internal" href="#response-concept">Response Concept</a></li>
<li><a class="reference internal" href="#directives">Directives</a></li>
<li><a class="reference internal" href="#modifiers">Modifiers</a></li>
<li><a class="reference internal" href="#wrappers">Wrappers</a></li>
</ul>
</li>
</ul>
<h3>Browse</h3>
<ul>
<li>Prev: <a href="reference_http_request.html">HTTP Request</a></li>
<li>Next: <a href="reference_http_server.html">HTTP Server API</a></li>
</ul>
<h3>You are here:</h3>
<ul>
<li>
<a href="index.html">cpp-netlib v0.9 documentation</a>
<ul><li><a href="reference.html">Reference Manual</a>
<ul><li>HTTP Response</li></ul>
</li></ul>
</li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/reference_http_response.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
</div>
</div>
<div id="ft">
<div class="nav">
« <a href="reference_http_request.html" title="HTTP Request">previous</a>
|
<a href="reference.html" title="Reference Manual" accesskey="U">up</a>
|
<a href="reference_http_server.html" title="HTTP Server API">next</a> »</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
documentation automatically generated by <a href="http://sphinx.pocoo.org">Sphinx</a> | style mostly stolen from <a href="http://lettuce.it">lettuce.it</a>
| background image attributed to <a href="http://www.flickr.com/photos/OrangeSmell">OrangeSmell</a>
</div>
</body>
</html>