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