Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / beast / doc / html / beast / ref / boost__beast__http__request.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>http::request</title>
5 <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Beast">
8 <link rel="up" href="../ref.html" title="This Page Intentionally Left Blank 2/2">
9 <link rel="prev" href="boost__beast__http__read_some/overload2.html" title="http::read_some (2 of 2 overloads)">
10 <link rel="next" href="boost__beast__http__request_header.html" title="http::request_header">
11 </head>
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15 <td align="center"><a href="../../../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../../../more/index.htm">More</a></td>
20 </tr></table>
21 <hr>
22 <div class="spirit-nav">
23 <a accesskey="p" href="boost__beast__http__read_some/overload2.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__http__request_header.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="beast.ref.boost__beast__http__request"></a><a class="link" href="boost__beast__http__request.html" title="http::request">http::request</a>
28 </h4></div></div></div>
29 <p>
30         <a class="indexterm" name="idm45873491887296"></a>
31 A typical HTTP request.
32       </p>
33 <h5>
34 <a name="beast.ref.boost__beast__http__request.h0"></a>
35         <span class="phrase"><a name="beast.ref.boost__beast__http__request.synopsis"></a></span><a class="link" href="boost__beast__http__request.html#beast.ref.boost__beast__http__request.synopsis">Synopsis</a>
36       </h5>
37 <p>
38         Defined in header <code class="literal">&lt;<a href="../../../../../../boost/beast/http/message.hpp" target="_top">boost/beast/http/message.hpp</a>&gt;</code>
39       </p>
40 <pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span>
41     <span class="keyword">class</span> <a class="link" href="../concepts/Body.html" title="Body"><span class="emphasis"><em>Body</em></span></a><span class="special">,</span>
42     <span class="keyword">class</span> <a class="link" href="../concepts/Fields.html" title="Fields"><span class="emphasis"><em>Fields</em></span></a> <span class="special">=</span> <span class="identifier">fields</span><span class="special">&gt;</span>
43 <span class="keyword">using</span> <span class="identifier">request</span> <span class="special">=</span> <span class="identifier">message</span><span class="special">&lt;</span> <span class="keyword">true</span><span class="special">,</span> <span class="identifier">Body</span><span class="special">,</span> <span class="identifier">Fields</span> <span class="special">&gt;;</span>
44 </pre>
45 <h5>
46 <a name="beast.ref.boost__beast__http__request.h1"></a>
47         <span class="phrase"><a name="beast.ref.boost__beast__http__request.types"></a></span><a class="link" href="boost__beast__http__request.html#beast.ref.boost__beast__http__request.types">Types</a>
48       </h5>
49 <div class="informaltable"><table class="table">
50 <colgroup>
51 <col>
52 <col>
53 </colgroup>
54 <thead><tr>
55 <th>
56                 <p>
57                   Name
58                 </p>
59               </th>
60 <th>
61                 <p>
62                   Description
63                 </p>
64               </th>
65 </tr></thead>
66 <tbody>
67 <tr>
68 <td>
69                 <p>
70                   <a class="link" href="boost__beast__http__message/body_type.html" title="http::message::body_type"><span class="bold"><strong>body_type</strong></span></a>
71                 </p>
72               </td>
73 <td>
74                 <p>
75                   The type providing the body traits.
76                 </p>
77               </td>
78 </tr>
79 <tr>
80 <td>
81                 <p>
82                   <a class="link" href="boost__beast__http__message/fields_type.html" title="http::message::fields_type"><span class="bold"><strong>fields_type</strong></span></a>
83                 </p>
84               </td>
85 <td>
86                 <p>
87                   The type representing the fields.
88                 </p>
89               </td>
90 </tr>
91 <tr>
92 <td>
93                 <p>
94                   <a class="link" href="boost__beast__http__message/header_type.html" title="http::message::header_type"><span class="bold"><strong>header_type</strong></span></a>
95                 </p>
96               </td>
97 <td>
98                 <p>
99                   The base class used to hold the header portion of the message.
100                 </p>
101               </td>
102 </tr>
103 <tr>
104 <td>
105                 <p>
106                   <a class="link" href="boost__beast__http__message/is_request.html" title="http::message::is_request"><span class="bold"><strong>is_request</strong></span></a>
107                 </p>
108               </td>
109 <td>
110                 <p>
111                   Indicates if the header is a request or response.
112                 </p>
113               </td>
114 </tr>
115 </tbody>
116 </table></div>
117 <h5>
118 <a name="beast.ref.boost__beast__http__request.h2"></a>
119         <span class="phrase"><a name="beast.ref.boost__beast__http__request.member_functions"></a></span><a class="link" href="boost__beast__http__request.html#beast.ref.boost__beast__http__request.member_functions">Member Functions</a>
120       </h5>
121 <div class="informaltable"><table class="table">
122 <colgroup>
123 <col>
124 <col>
125 </colgroup>
126 <thead><tr>
127 <th>
128                 <p>
129                   Name
130                 </p>
131               </th>
132 <th>
133                 <p>
134                   Description
135                 </p>
136               </th>
137 </tr></thead>
138 <tbody>
139 <tr>
140 <td>
141                 <p>
142                   <a class="link" href="boost__beast__http__message/base.html" title="http::message::base"><span class="bold"><strong>base</strong></span></a>
143                 </p>
144               </td>
145 <td>
146                 <p>
147                   Returns the header portion of the message.
148                 </p>
149               </td>
150 </tr>
151 <tr>
152 <td>
153                 <p>
154                   <a class="link" href="boost__beast__http__message/body.html" title="http::message::body"><span class="bold"><strong>body</strong></span></a>
155                 </p>
156               </td>
157 <td>
158                 <p>
159                   Returns the body.
160                 </p>
161               </td>
162 </tr>
163 <tr>
164 <td>
165                 <p>
166                   <a class="link" href="boost__beast__http__message/chunked.html" title="http::message::chunked"><span class="bold"><strong>chunked</strong></span></a>
167                 </p>
168               </td>
169 <td>
170                 <p>
171                   Returns true if the chunked Transfer-Encoding is specified.
172                 </p>
173                 <p>
174                   Set or clear the chunked Transfer-Encoding.
175                 </p>
176               </td>
177 </tr>
178 <tr>
179 <td>
180                 <p>
181                   <a class="link" href="boost__beast__http__message/content_length.html" title="http::message::content_length"><span class="bold"><strong>content_length</strong></span></a>
182                 </p>
183               </td>
184 <td>
185                 <p>
186                   Set or clear the Content-Length field.
187                 </p>
188               </td>
189 </tr>
190 <tr>
191 <td>
192                 <p>
193                   <a class="link" href="boost__beast__http__message/has_content_length.html" title="http::message::has_content_length"><span class="bold"><strong>has_content_length</strong></span></a>
194                 </p>
195               </td>
196 <td>
197                 <p>
198                   Returns true if the Content-Length field is present.
199                 </p>
200               </td>
201 </tr>
202 <tr>
203 <td>
204                 <p>
205                   <a class="link" href="boost__beast__http__message/keep_alive.html" title="http::message::keep_alive"><span class="bold"><strong>keep_alive</strong></span></a>
206                 </p>
207               </td>
208 <td>
209                 <p>
210                   Returns true if the message semantics indicate keep-alive.
211                 </p>
212                 <p>
213                   Set the keep-alive message semantic option.
214                 </p>
215               </td>
216 </tr>
217 <tr>
218 <td>
219                 <p>
220                   <a class="link" href="boost__beast__http__message/message.html" title="http::message::message"><span class="bold"><strong>message</strong></span></a>
221                 </p>
222               </td>
223 <td>
224                 <p>
225                   Constructor.
226                 </p>
227                 <p>
228                   Construct a message.
229                 </p>
230               </td>
231 </tr>
232 <tr>
233 <td>
234                 <p>
235                   <a class="link" href="boost__beast__http__message/method.html" title="http::message::method"><span class="bold"><strong>method</strong></span></a>
236                 </p>
237               </td>
238 <td>
239                 <p>
240                   Return the request-method verb.
241                 </p>
242                 <p>
243                   Set the request-method.
244                 </p>
245               </td>
246 </tr>
247 <tr>
248 <td>
249                 <p>
250                   <a class="link" href="boost__beast__http__message/method_string.html" title="http::message::method_string"><span class="bold"><strong>method_string</strong></span></a>
251                 </p>
252               </td>
253 <td>
254                 <p>
255                   Return the request-method as a string.
256                 </p>
257               </td>
258 </tr>
259 <tr>
260 <td>
261                 <p>
262                   <a class="link" href="boost__beast__http__message/need_eof.html" title="http::message::need_eof"><span class="bold"><strong>need_eof</strong></span></a>
263                 </p>
264               </td>
265 <td>
266                 <p>
267                   Returns true if the message semantics require an end of file.
268                 </p>
269               </td>
270 </tr>
271 <tr>
272 <td>
273                 <p>
274                   <a class="link" href="boost__beast__http__message/operator_eq_.html" title="http::message::operator="><span class="bold"><strong>operator=</strong></span></a>
275                 </p>
276               </td>
277 <td>
278                 <p>
279                   Assignment.
280                 </p>
281               </td>
282 </tr>
283 <tr>
284 <td>
285                 <p>
286                   <a class="link" href="boost__beast__http__message/payload_size.html" title="http::message::payload_size"><span class="bold"><strong>payload_size</strong></span></a>
287                 </p>
288               </td>
289 <td>
290                 <p>
291                   Returns the payload size of the body in octets if possible.
292                 </p>
293               </td>
294 </tr>
295 <tr>
296 <td>
297                 <p>
298                   <a class="link" href="boost__beast__http__message/prepare_payload.html" title="http::message::prepare_payload"><span class="bold"><strong>prepare_payload</strong></span></a>
299                 </p>
300               </td>
301 <td>
302                 <p>
303                   Prepare the message payload fields for the body.
304                 </p>
305               </td>
306 </tr>
307 <tr>
308 <td>
309                 <p>
310                   <a class="link" href="boost__beast__http__message/reason.html" title="http::message::reason"><span class="bold"><strong>reason</strong></span></a>
311                 </p>
312               </td>
313 <td>
314                 <p>
315                   Return the response reason-phrase.
316                 </p>
317                 <p>
318                   Set the response reason-phrase (deprecated)
319                 </p>
320               </td>
321 </tr>
322 <tr>
323 <td>
324                 <p>
325                   <a class="link" href="boost__beast__http__message/result.html" title="http::message::result"><span class="bold"><strong>result</strong></span></a>
326                 </p>
327               </td>
328 <td>
329                 <p>
330                   The response status-code result.
331                 </p>
332                 <p>
333                   Set the response status-code.
334                 </p>
335                 <p>
336                   Set the response status-code as an integer.
337                 </p>
338               </td>
339 </tr>
340 <tr>
341 <td>
342                 <p>
343                   <a class="link" href="boost__beast__http__message/result_int.html" title="http::message::result_int"><span class="bold"><strong>result_int</strong></span></a>
344                 </p>
345               </td>
346 <td>
347                 <p>
348                   The response status-code expressed as an integer.
349                 </p>
350               </td>
351 </tr>
352 <tr>
353 <td>
354                 <p>
355                   <a class="link" href="boost__beast__http__message/target.html" title="http::message::target"><span class="bold"><strong>target</strong></span></a>
356                 </p>
357               </td>
358 <td>
359                 <p>
360                   Returns the request-target string.
361                 </p>
362                 <p>
363                   Set the request-target string.
364                 </p>
365               </td>
366 </tr>
367 <tr>
368 <td>
369                 <p>
370                   <a class="link" href="boost__beast__http__message/version.html" title="http::message::version"><span class="bold"><strong>version</strong></span></a>
371                 </p>
372               </td>
373 <td>
374                 <p>
375                   Return the HTTP-version.
376                 </p>
377                 <p>
378                   Set the HTTP-version.
379                 </p>
380               </td>
381 </tr>
382 </tbody>
383 </table></div>
384 <p>
385         This container is derived from the <code class="computeroutput"><span class="identifier">Fields</span></code>
386         template type. To understand all of the members of this class it is necessary
387         to view the declaration for the <code class="computeroutput"><span class="identifier">Fields</span></code>
388         type. When using the default fields container, those declarations are in
389         <a class="link" href="boost__beast__http__fields.html" title="http::fields"><code class="computeroutput"><span class="identifier">http</span><span class="special">::</span><span class="identifier">fields</span></code></a>.
390         A message can be a request or response, depending on the <code class="computeroutput"><span class="identifier">isRequest</span></code>
391         template argument value. Requests and responses have different types; functions
392         may be overloaded based on the type if desired. The <code class="computeroutput"><span class="identifier">Body</span></code>
393         template argument type determines the model used to read or write the content
394         body of the message. Newly constructed messages objects have version set
395         to HTTP/1.1. Newly constructed response objects also have result code set
396         to <a class="link" href="boost__beast__http__status.html" title="http::status"><code class="computeroutput"><span class="identifier">http</span><span class="special">::</span><span class="identifier">ok</span></code></a>.
397       </p>
398 <h5>
399 <a name="beast.ref.boost__beast__http__request.h3"></a>
400         <span class="phrase"><a name="beast.ref.boost__beast__http__request.template_parameters"></a></span><a class="link" href="boost__beast__http__request.html#beast.ref.boost__beast__http__request.template_parameters">Template
401         Parameters</a>
402       </h5>
403 <div class="informaltable"><table class="table">
404 <colgroup>
405 <col>
406 <col>
407 </colgroup>
408 <thead><tr>
409 <th>
410                 <p>
411                   Type
412                 </p>
413               </th>
414 <th>
415                 <p>
416                   Description
417                 </p>
418               </th>
419 </tr></thead>
420 <tbody>
421 <tr>
422 <td>
423                 <p>
424                   <code class="computeroutput"><span class="identifier">isRequest</span></code>
425                 </p>
426               </td>
427 <td>
428                 <p>
429                   <code class="computeroutput"><span class="keyword">true</span></code> if this represents
430                   a request, or <code class="computeroutput"><span class="keyword">false</span></code>
431                   if this represents a response. Some class data members are conditionally
432                   present depending on this value.
433                 </p>
434               </td>
435 </tr>
436 <tr>
437 <td>
438                 <p>
439                   <code class="computeroutput"><span class="identifier">Body</span></code>
440                 </p>
441               </td>
442 <td>
443                 <p>
444                   A type meeting the requirements of Body.
445                 </p>
446               </td>
447 </tr>
448 <tr>
449 <td>
450                 <p>
451                   <code class="computeroutput"><span class="identifier">Fields</span></code>
452                 </p>
453               </td>
454 <td>
455                 <p>
456                   The type of container used to hold the field value pairs.
457                 </p>
458               </td>
459 </tr>
460 </tbody>
461 </table></div>
462 <h5>
463 <a name="beast.ref.boost__beast__http__request.h4"></a>
464         <span class="phrase"><a name="beast.ref.boost__beast__http__request.description"></a></span><a class="link" href="boost__beast__http__request.html#beast.ref.boost__beast__http__request.description">Description</a>
465       </h5>
466 <p>
467         Convenience header <code class="literal">&lt;<a href="../../../../../../boost/beast/http.hpp" target="_top">boost/beast/http.hpp</a>&gt;</code>
468       </p>
469 </div>
470 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
471 <td align="left"></td>
472 <td align="right"><div class="copyright-footer">Copyright &#169; 2016-2019 Vinnie
473       Falco<p>
474         Distributed under the Boost Software License, Version 1.0. (See accompanying
475         file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
476       </p>
477 </div></td>
478 </tr></table>
479 <hr>
480 <div class="spirit-nav">
481 <a accesskey="p" href="boost__beast__http__read_some/overload2.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__http__request_header.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
482 </div>
483 </body>
484 </html>