Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / beast / doc / html / beast / ref / boost__beast__http__response_parser.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>http::response_parser</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__response_header.html" title="http::response_header">
10 <link rel="next" href="boost__beast__http__response_serializer.html" title="http::response_serializer">
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_serializer.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__response_parser"></a><a class="link" href="boost__beast__http__response_parser.html" title="http::response_parser">http::response_parser</a>
28 </h4></div></div></div>
29 <p>
30         <a class="indexterm" name="idm45873491152016"></a>
31 An HTTP/1 parser for producing a response message.
32       </p>
33 <h5>
34 <a name="beast.ref.boost__beast__http__response_parser.h0"></a>
35         <span class="phrase"><a name="beast.ref.boost__beast__http__response_parser.synopsis"></a></span><a class="link" href="boost__beast__http__response_parser.html#beast.ref.boost__beast__http__response_parser.synopsis">Synopsis</a>
36       </h5>
37 <p>
38         Defined in header <code class="literal">&lt;<a href="../../../../../../boost/beast/http/parser.hpp" target="_top">boost/beast/http/parser.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 href="https://en.cppreference.com/w/cpp/named_req/Allocator" target="_top"><span class="emphasis"><em>Allocator</em></span></a> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">&gt;&gt;</span>
43 <span class="keyword">using</span> <span class="identifier">response_parser</span> <span class="special">=</span> <span class="identifier">parser</span><span class="special">&lt;</span> <span class="keyword">false</span><span class="special">,</span> <span class="identifier">Body</span><span class="special">,</span> <span class="identifier">Allocator</span> <span class="special">&gt;;</span>
44 </pre>
45 <h5>
46 <a name="beast.ref.boost__beast__http__response_parser.h1"></a>
47         <span class="phrase"><a name="beast.ref.boost__beast__http__response_parser.types"></a></span><a class="link" href="boost__beast__http__response_parser.html#beast.ref.boost__beast__http__response_parser.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__parser/is_request.html" title="http::parser::is_request"><span class="bold"><strong>is_request</strong></span></a>
71                 </p>
72               </td>
73 <td>
74                 <p>
75                   true if this parser parses requests, false for responses.
76                 </p>
77               </td>
78 </tr>
79 <tr>
80 <td>
81                 <p>
82                   <a class="link" href="boost__beast__http__parser/value_type.html" title="http::parser::value_type"><span class="bold"><strong>value_type</strong></span></a>
83                 </p>
84               </td>
85 <td>
86                 <p>
87                   The type of message returned by the parser.
88                 </p>
89               </td>
90 </tr>
91 </tbody>
92 </table></div>
93 <h5>
94 <a name="beast.ref.boost__beast__http__response_parser.h2"></a>
95         <span class="phrase"><a name="beast.ref.boost__beast__http__response_parser.member_functions"></a></span><a class="link" href="boost__beast__http__response_parser.html#beast.ref.boost__beast__http__response_parser.member_functions">Member
96         Functions</a>
97       </h5>
98 <div class="informaltable"><table class="table">
99 <colgroup>
100 <col>
101 <col>
102 </colgroup>
103 <thead><tr>
104 <th>
105                 <p>
106                   Name
107                 </p>
108               </th>
109 <th>
110                 <p>
111                   Description
112                 </p>
113               </th>
114 </tr></thead>
115 <tbody>
116 <tr>
117 <td>
118                 <p>
119                   <a class="link" href="boost__beast__http__parser/body_limit.html" title="http::parser::body_limit"><span class="bold"><strong>body_limit</strong></span></a>
120                 </p>
121               </td>
122 <td>
123                 <p>
124                   Set the limit on the payload body.
125                 </p>
126               </td>
127 </tr>
128 <tr>
129 <td>
130                 <p>
131                   <a class="link" href="boost__beast__http__parser/chunked.html" title="http::parser::chunked"><span class="bold"><strong>chunked</strong></span></a>
132                 </p>
133               </td>
134 <td>
135                 <p>
136                   Returns true if the last value for Transfer-Encoding is "chunked".
137                 </p>
138               </td>
139 </tr>
140 <tr>
141 <td>
142                 <p>
143                   <a class="link" href="boost__beast__http__parser/content_length.html" title="http::parser::content_length"><span class="bold"><strong>content_length</strong></span></a>
144                 </p>
145               </td>
146 <td>
147                 <p>
148                   Returns the optional value of Content-Length if known.
149                 </p>
150               </td>
151 </tr>
152 <tr>
153 <td>
154                 <p>
155                   <a class="link" href="boost__beast__http__parser/content_length_remaining.html" title="http::parser::content_length_remaining"><span class="bold"><strong>content_length_remaining</strong></span></a>
156                 </p>
157               </td>
158 <td>
159                 <p>
160                   Returns the remaining content length if known.
161                 </p>
162               </td>
163 </tr>
164 <tr>
165 <td>
166                 <p>
167                   <a class="link" href="boost__beast__http__parser/eager.html" title="http::parser::eager"><span class="bold"><strong>eager</strong></span></a>
168                 </p>
169               </td>
170 <td>
171                 <p>
172                   Returns true if the eager parse option is set.
173                 </p>
174                 <p>
175                   Set the eager parse option.
176                 </p>
177               </td>
178 </tr>
179 <tr>
180 <td>
181                 <p>
182                   <a class="link" href="boost__beast__http__parser/get.html" title="http::parser::get"><span class="bold"><strong>get</strong></span></a>
183                 </p>
184               </td>
185 <td>
186                 <p>
187                   Returns the parsed message.
188                 </p>
189               </td>
190 </tr>
191 <tr>
192 <td>
193                 <p>
194                   <a class="link" href="boost__beast__http__parser/got_some.html" title="http::parser::got_some"><span class="bold"><strong>got_some</strong></span></a>
195                 </p>
196               </td>
197 <td>
198                 <p>
199                   Returns true if the parser has received at least one byte of input.
200                 </p>
201               </td>
202 </tr>
203 <tr>
204 <td>
205                 <p>
206                   <a class="link" href="boost__beast__http__parser/header_limit.html" title="http::parser::header_limit"><span class="bold"><strong>header_limit</strong></span></a>
207                 </p>
208               </td>
209 <td>
210                 <p>
211                   Set a limit on the total size of the header.
212                 </p>
213               </td>
214 </tr>
215 <tr>
216 <td>
217                 <p>
218                   <a class="link" href="boost__beast__http__parser/is_done.html" title="http::parser::is_done"><span class="bold"><strong>is_done</strong></span></a>
219                 </p>
220               </td>
221 <td>
222                 <p>
223                   Returns true if the message is complete.
224                 </p>
225               </td>
226 </tr>
227 <tr>
228 <td>
229                 <p>
230                   <a class="link" href="boost__beast__http__parser/is_header_done.html" title="http::parser::is_header_done"><span class="bold"><strong>is_header_done</strong></span></a>
231                 </p>
232               </td>
233 <td>
234                 <p>
235                   Returns true if a the parser has produced the full header.
236                 </p>
237               </td>
238 </tr>
239 <tr>
240 <td>
241                 <p>
242                   <a class="link" href="boost__beast__http__parser/keep_alive.html" title="http::parser::keep_alive"><span class="bold"><strong>keep_alive</strong></span></a>
243                 </p>
244               </td>
245 <td>
246                 <p>
247                   Returns true if the message has keep-alive connection semantics.
248                 </p>
249               </td>
250 </tr>
251 <tr>
252 <td>
253                 <p>
254                   <a class="link" href="boost__beast__http__parser/need_eof.html" title="http::parser::need_eof"><span class="bold"><strong>need_eof</strong></span></a>
255                 </p>
256               </td>
257 <td>
258                 <p>
259                   Returns true if the message semantics require an end of file.
260                 </p>
261               </td>
262 </tr>
263 <tr>
264 <td>
265                 <p>
266                   <a class="link" href="boost__beast__http__parser/on_chunk_body.html" title="http::parser::on_chunk_body"><span class="bold"><strong>on_chunk_body</strong></span></a>
267                 </p>
268               </td>
269 <td>
270                 <p>
271                   Set a callback to be invoked on chunk body data.
272                 </p>
273               </td>
274 </tr>
275 <tr>
276 <td>
277                 <p>
278                   <a class="link" href="boost__beast__http__parser/on_chunk_header.html" title="http::parser::on_chunk_header"><span class="bold"><strong>on_chunk_header</strong></span></a>
279                 </p>
280               </td>
281 <td>
282                 <p>
283                   Set a callback to be invoked on each chunk header.
284                 </p>
285               </td>
286 </tr>
287 <tr>
288 <td>
289                 <p>
290                   <a class="link" href="boost__beast__http__parser/operator_eq_.html" title="http::parser::operator="><span class="bold"><strong>operator=</strong></span></a>
291                 </p>
292               </td>
293 <td>
294                 <p>
295                   Assignment (disallowed)
296                 </p>
297               </td>
298 </tr>
299 <tr>
300 <td>
301                 <p>
302                   <a class="link" href="boost__beast__http__parser/parser.html" title="http::parser::parser"><span class="bold"><strong>parser</strong></span></a>
303                 </p>
304               </td>
305 <td>
306                 <p>
307                   Constructor (disallowed)
308                 </p>
309                 <p>
310                   Constructor.
311                 </p>
312                 <p>
313                   Construct a parser from another parser, changing the Body type.
314                 </p>
315               </td>
316 </tr>
317 <tr>
318 <td>
319                 <p>
320                   <a class="link" href="boost__beast__http__parser/put.html" title="http::parser::put"><span class="bold"><strong>put</strong></span></a>
321                 </p>
322               </td>
323 <td>
324                 <p>
325                   Write a buffer sequence to the parser.
326                 </p>
327               </td>
328 </tr>
329 <tr>
330 <td>
331                 <p>
332                   <a class="link" href="boost__beast__http__parser/put_eof.html" title="http::parser::put_eof"><span class="bold"><strong>put_eof</strong></span></a>
333                 </p>
334               </td>
335 <td>
336                 <p>
337                   Inform the parser that the end of stream was reached.
338                 </p>
339               </td>
340 </tr>
341 <tr>
342 <td>
343                 <p>
344                   <a class="link" href="boost__beast__http__parser/release.html" title="http::parser::release"><span class="bold"><strong>release</strong></span></a>
345                 </p>
346               </td>
347 <td>
348                 <p>
349                   Returns ownership of the parsed message.
350                 </p>
351               </td>
352 </tr>
353 <tr>
354 <td>
355                 <p>
356                   <a class="link" href="boost__beast__http__parser/skip.html" title="http::parser::skip"><span class="bold"><strong>skip</strong></span></a>
357                 </p>
358               </td>
359 <td>
360                 <p>
361                   Returns true if the skip parse option is set.
362                 </p>
363                 <p>
364                   Set the skip parse option.
365                 </p>
366               </td>
367 </tr>
368 <tr>
369 <td>
370                 <p>
371                   <a class="link" href="boost__beast__http__parser/upgrade.html" title="http::parser::upgrade"><span class="bold"><strong>upgrade</strong></span></a>
372                 </p>
373               </td>
374 <td>
375                 <p>
376                   Returns true if the message is an upgrade message.
377                 </p>
378               </td>
379 </tr>
380 <tr>
381 <td>
382                 <p>
383                   <a class="link" href="boost__beast__http__parser/parser_dtor_.html" title="http::parser::~parser"><span class="bold"><strong>~parser</strong></span></a>
384                 </p>
385               </td>
386 <td>
387                 <p>
388                   Destructor.
389                 </p>
390               </td>
391 </tr>
392 </tbody>
393 </table></div>
394 <p>
395         This class uses the basic HTTP/1 wire format parser to convert a series of
396         octets into a <a class="link" href="boost__beast__http__message.html" title="http::message"><code class="computeroutput"><span class="identifier">http</span><span class="special">::</span><span class="identifier">message</span></code></a> using the <a class="link" href="boost__beast__http__basic_fields.html" title="http::basic_fields"><code class="computeroutput"><span class="identifier">http</span><span class="special">::</span><span class="identifier">basic_fields</span></code></a> container to represent
397         the fields.
398       </p>
399 <h5>
400 <a name="beast.ref.boost__beast__http__response_parser.h3"></a>
401         <span class="phrase"><a name="beast.ref.boost__beast__http__response_parser.template_parameters"></a></span><a class="link" href="boost__beast__http__response_parser.html#beast.ref.boost__beast__http__response_parser.template_parameters">Template
402         Parameters</a>
403       </h5>
404 <div class="informaltable"><table class="table">
405 <colgroup>
406 <col>
407 <col>
408 </colgroup>
409 <thead><tr>
410 <th>
411                 <p>
412                   Type
413                 </p>
414               </th>
415 <th>
416                 <p>
417                   Description
418                 </p>
419               </th>
420 </tr></thead>
421 <tbody>
422 <tr>
423 <td>
424                 <p>
425                   <code class="computeroutput"><span class="identifier">isRequest</span></code>
426                 </p>
427               </td>
428 <td>
429                 <p>
430                   Indicates whether a request or response will be parsed.
431                 </p>
432               </td>
433 </tr>
434 <tr>
435 <td>
436                 <p>
437                   <code class="computeroutput"><span class="identifier">Body</span></code>
438                 </p>
439               </td>
440 <td>
441                 <p>
442                   The type used to represent the body. This must meet the requirements
443                   of <span class="emphasis"><em>Body</em></span>.
444                 </p>
445               </td>
446 </tr>
447 <tr>
448 <td>
449                 <p>
450                   <code class="computeroutput"><span class="identifier">Allocator</span></code>
451                 </p>
452               </td>
453 <td>
454                 <p>
455                   The type of allocator used with the <a class="link" href="boost__beast__http__basic_fields.html" title="http::basic_fields"><code class="computeroutput"><span class="identifier">http</span><span class="special">::</span><span class="identifier">basic_fields</span></code></a> container.
456                 </p>
457               </td>
458 </tr>
459 </tbody>
460 </table></div>
461 <h5>
462 <a name="beast.ref.boost__beast__http__response_parser.h4"></a>
463         <span class="phrase"><a name="beast.ref.boost__beast__http__response_parser.remarks"></a></span><a class="link" href="boost__beast__http__response_parser.html#beast.ref.boost__beast__http__response_parser.remarks">Remarks</a>
464       </h5>
465 <p>
466         A new instance of the parser is required for each message.
467       </p>
468 <h5>
469 <a name="beast.ref.boost__beast__http__response_parser.h5"></a>
470         <span class="phrase"><a name="beast.ref.boost__beast__http__response_parser.description"></a></span><a class="link" href="boost__beast__http__response_parser.html#beast.ref.boost__beast__http__response_parser.description">Description</a>
471       </h5>
472 <p>
473         Convenience header <code class="literal">&lt;<a href="../../../../../../boost/beast/http.hpp" target="_top">boost/beast/http.hpp</a>&gt;</code>
474       </p>
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 &#169; 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_serializer.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
488 </div>
489 </body>
490 </html>