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