1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>http::fields</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__dynamic_body.html" title="http::dynamic_body"> 10<link rel="next" href="boost__beast__http__file_body.html" title="http::file_body"> 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__dynamic_body.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__file_body.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__fields"></a><a class="link" href="boost__beast__http__fields.html" title="http::fields">http::fields</a> 28</h4></div></div></div> 29<p> 30 <a class="indexterm" name="idm46057509035568"></a> 31 </p> 32<p> 33 A typical HTTP header fields container. 34 </p> 35<h5> 36<a name="beast.ref.boost__beast__http__fields.h0"></a> 37 <span class="phrase"><a name="beast.ref.boost__beast__http__fields.synopsis"></a></span><a class="link" href="boost__beast__http__fields.html#beast.ref.boost__beast__http__fields.synopsis">Synopsis</a> 38 </h5> 39<p> 40 Defined in header <code class="literal"><<a href="../../../../../../boost/beast/http/fields.hpp" target="_top">boost/beast/http/fields.hpp</a>></code> 41 </p> 42<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">fields</span> <span class="special">=</span> <span class="identifier">basic_fields</span><span class="special"><</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special"><</span> <span class="keyword">char</span> <span class="special">></span> <span class="special">>;</span> 43</pre> 44<h5> 45<a name="beast.ref.boost__beast__http__fields.h1"></a> 46 <span class="phrase"><a name="beast.ref.boost__beast__http__fields.types"></a></span><a class="link" href="boost__beast__http__fields.html#beast.ref.boost__beast__http__fields.types">Types</a> 47 </h5> 48<div class="informaltable"><table class="table"> 49<colgroup> 50<col> 51<col> 52</colgroup> 53<thead><tr> 54<th> 55 <p> 56 Name 57 </p> 58 </th> 59<th> 60 <p> 61 Description 62 </p> 63 </th> 64</tr></thead> 65<tbody> 66<tr> 67<td> 68 <p> 69 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/allocator_type.html" title="http::basic_fields::allocator_type">allocator_type</a></strong></span> 70 </p> 71 </td> 72<td> 73 <p> 74 The type of allocator used. 75 </p> 76 </td> 77</tr> 78<tr> 79<td> 80 <p> 81 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/const_iterator.html" title="http::basic_fields::const_iterator">const_iterator</a></strong></span> 82 </p> 83 </td> 84<td> 85 <p> 86 A constant iterator to the field sequence. 87 </p> 88 </td> 89</tr> 90<tr> 91<td> 92 <p> 93 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/iterator.html" title="http::basic_fields::iterator">iterator</a></strong></span> 94 </p> 95 </td> 96<td> 97 <p> 98 A constant iterator to the field sequence. 99 </p> 100 </td> 101</tr> 102<tr> 103<td> 104 <p> 105 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/key_compare.html" title="http::basic_fields::key_compare">key_compare</a></strong></span> 106 </p> 107 </td> 108<td> 109 <p> 110 A strictly less predicate for comparing keys, using a case-insensitive 111 comparison. 112 </p> 113 </td> 114</tr> 115<tr> 116<td> 117 <p> 118 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields__value_type.html" title="http::basic_fields::value_type">value_type</a></strong></span> 119 </p> 120 </td> 121<td> 122 <p> 123 The type of element used to represent a field. 124 </p> 125 </td> 126</tr> 127<tr> 128<td> 129 <p> 130 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/writer.html" title="http::basic_fields::writer">writer</a></strong></span> 131 </p> 132 </td> 133<td> 134 <p> 135 The algorithm used to serialize the header. 136 </p> 137 </td> 138</tr> 139</tbody> 140</table></div> 141<h5> 142<a name="beast.ref.boost__beast__http__fields.h2"></a> 143 <span class="phrase"><a name="beast.ref.boost__beast__http__fields.member_functions"></a></span><a class="link" href="boost__beast__http__fields.html#beast.ref.boost__beast__http__fields.member_functions">Member Functions</a> 144 </h5> 145<div class="informaltable"><table class="table"> 146<colgroup> 147<col> 148<col> 149</colgroup> 150<thead><tr> 151<th> 152 <p> 153 Name 154 </p> 155 </th> 156<th> 157 <p> 158 Description 159 </p> 160 </th> 161</tr></thead> 162<tbody> 163<tr> 164<td> 165 <p> 166 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/at.html" title="http::basic_fields::at">at</a></strong></span> 167 </p> 168 </td> 169<td> 170 <p> 171 Returns the value for a field, or throws an exception. 172 </p> 173 </td> 174</tr> 175<tr> 176<td> 177 <p> 178 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/basic_fields.html" title="http::basic_fields::basic_fields">basic_fields</a></strong></span> 179 </p> 180 </td> 181<td> 182 <p> 183 Constructor. 184 </p> 185 <p> 186 Move constructor. 187 </p> 188 <p> 189 Copy constructor. 190 </p> 191 </td> 192</tr> 193<tr> 194<td> 195 <p> 196 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/begin.html" title="http::basic_fields::begin">begin</a></strong></span> 197 </p> 198 </td> 199<td> 200 <p> 201 Return a const iterator to the beginning of the field sequence. 202 </p> 203 </td> 204</tr> 205<tr> 206<td> 207 <p> 208 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/cbegin.html" title="http::basic_fields::cbegin">cbegin</a></strong></span> 209 </p> 210 </td> 211<td> 212 <p> 213 Return a const iterator to the beginning of the field sequence. 214 </p> 215 </td> 216</tr> 217<tr> 218<td> 219 <p> 220 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/cend.html" title="http::basic_fields::cend">cend</a></strong></span> 221 </p> 222 </td> 223<td> 224 <p> 225 Return a const iterator to the end of the field sequence. 226 </p> 227 </td> 228</tr> 229<tr> 230<td> 231 <p> 232 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/clear.html" title="http::basic_fields::clear">clear</a></strong></span> 233 </p> 234 </td> 235<td> 236 <p> 237 Remove all fields from the container. 238 </p> 239 </td> 240</tr> 241<tr> 242<td> 243 <p> 244 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/count.html" title="http::basic_fields::count">count</a></strong></span> 245 </p> 246 </td> 247<td> 248 <p> 249 Return the number of fields with the specified name. 250 </p> 251 </td> 252</tr> 253<tr> 254<td> 255 <p> 256 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/end.html" title="http::basic_fields::end">end</a></strong></span> 257 </p> 258 </td> 259<td> 260 <p> 261 Return a const iterator to the end of the field sequence. 262 </p> 263 </td> 264</tr> 265<tr> 266<td> 267 <p> 268 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/equal_range.html" title="http::basic_fields::equal_range">equal_range</a></strong></span> 269 </p> 270 </td> 271<td> 272 <p> 273 Returns a range of iterators to the fields with the specified name. 274 </p> 275 </td> 276</tr> 277<tr> 278<td> 279 <p> 280 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/erase.html" title="http::basic_fields::erase">erase</a></strong></span> 281 </p> 282 </td> 283<td> 284 <p> 285 Remove a field. 286 </p> 287 <p> 288 Remove all fields with the specified name. 289 </p> 290 </td> 291</tr> 292<tr> 293<td> 294 <p> 295 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/find.html" title="http::basic_fields::find">find</a></strong></span> 296 </p> 297 </td> 298<td> 299 <p> 300 Returns an iterator to the case-insensitive matching field. 301 </p> 302 <p> 303 Returns an iterator to the case-insensitive matching field name. 304 </p> 305 </td> 306</tr> 307<tr> 308<td> 309 <p> 310 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/get_allocator.html" title="http::basic_fields::get_allocator">get_allocator</a></strong></span> 311 </p> 312 </td> 313<td> 314 <p> 315 Return a copy of the allocator associated with the container. 316 </p> 317 </td> 318</tr> 319<tr> 320<td> 321 <p> 322 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/insert.html" title="http::basic_fields::insert">insert</a></strong></span> 323 </p> 324 </td> 325<td> 326 <p> 327 Insert a field. 328 </p> 329 </td> 330</tr> 331<tr> 332<td> 333 <p> 334 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/key_comp.html" title="http::basic_fields::key_comp">key_comp</a></strong></span> 335 </p> 336 </td> 337<td> 338 <p> 339 Returns a copy of the key comparison function. 340 </p> 341 </td> 342</tr> 343<tr> 344<td> 345 <p> 346 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/operator_eq_.html" title="http::basic_fields::operator=">operator=</a></strong></span> 347 </p> 348 </td> 349<td> 350 <p> 351 Move assignment. 352 </p> 353 <p> 354 Copy assignment. 355 </p> 356 </td> 357</tr> 358<tr> 359<td> 360 <p> 361 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/operator_lb__rb_.html" title="http::basic_fields::operator[]">operator[]</a></strong></span> 362 </p> 363 </td> 364<td> 365 <p> 366 Returns the value for a field, or <code class="computeroutput"><span class="string">""</span></code> 367 if it does not exist. 368 </p> 369 <p> 370 Returns the value for a case-insensitive matching header, or <code class="computeroutput"><span class="string">""</span></code> if it does not exist. 371 </p> 372 </td> 373</tr> 374<tr> 375<td> 376 <p> 377 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/set.html" title="http::basic_fields::set">set</a></strong></span> 378 </p> 379 </td> 380<td> 381 <p> 382 Set a field value, removing any other instances of that field. 383 </p> 384 </td> 385</tr> 386<tr> 387<td> 388 <p> 389 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/swap.html" title="http::basic_fields::swap">swap</a></strong></span> 390 </p> 391 </td> 392<td> 393 <p> 394 Return a buffer sequence representing the trailers. 395 </p> 396 </td> 397</tr> 398<tr> 399<td> 400 <p> 401 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/_basic_fields.html" title="http::basic_fields::~basic_fields">~basic_fields</a></strong></span> 402 </p> 403 </td> 404<td> 405 <p> 406 Destructor. 407 </p> 408 </td> 409</tr> 410</tbody> 411</table></div> 412<h5> 413<a name="beast.ref.boost__beast__http__fields.h3"></a> 414 <span class="phrase"><a name="beast.ref.boost__beast__http__fields.protected_member_functions"></a></span><a class="link" href="boost__beast__http__fields.html#beast.ref.boost__beast__http__fields.protected_member_functions">Protected 415 Member Functions</a> 416 </h5> 417<div class="informaltable"><table class="table"> 418<colgroup> 419<col> 420<col> 421</colgroup> 422<thead><tr> 423<th> 424 <p> 425 Name 426 </p> 427 </th> 428<th> 429 <p> 430 Description 431 </p> 432 </th> 433</tr></thead> 434<tbody> 435<tr> 436<td> 437 <p> 438 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/get_chunked_impl.html" title="http::basic_fields::get_chunked_impl">get_chunked_impl</a></strong></span> 439 </p> 440 </td> 441<td> 442 <p> 443 Returns the chunked Transfer-Encoding setting. 444 </p> 445 </td> 446</tr> 447<tr> 448<td> 449 <p> 450 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/get_keep_alive_impl.html" title="http::basic_fields::get_keep_alive_impl">get_keep_alive_impl</a></strong></span> 451 </p> 452 </td> 453<td> 454 <p> 455 Returns the keep-alive setting. 456 </p> 457 </td> 458</tr> 459<tr> 460<td> 461 <p> 462 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/get_method_impl.html" title="http::basic_fields::get_method_impl">get_method_impl</a></strong></span> 463 </p> 464 </td> 465<td> 466 <p> 467 Returns the request-method string. 468 </p> 469 </td> 470</tr> 471<tr> 472<td> 473 <p> 474 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/get_reason_impl.html" title="http::basic_fields::get_reason_impl">get_reason_impl</a></strong></span> 475 </p> 476 </td> 477<td> 478 <p> 479 Returns the response reason-phrase string. 480 </p> 481 </td> 482</tr> 483<tr> 484<td> 485 <p> 486 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/get_target_impl.html" title="http::basic_fields::get_target_impl">get_target_impl</a></strong></span> 487 </p> 488 </td> 489<td> 490 <p> 491 Returns the request-target string. 492 </p> 493 </td> 494</tr> 495<tr> 496<td> 497 <p> 498 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/has_content_length_impl.html" title="http::basic_fields::has_content_length_impl">has_content_length_impl</a></strong></span> 499 </p> 500 </td> 501<td> 502 <p> 503 Returns <code class="computeroutput"><span class="keyword">true</span></code> if the 504 Content-Length field is present. 505 </p> 506 </td> 507</tr> 508<tr> 509<td> 510 <p> 511 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/set_chunked_impl.html" title="http::basic_fields::set_chunked_impl">set_chunked_impl</a></strong></span> 512 </p> 513 </td> 514<td> 515 <p> 516 Adjusts the chunked Transfer-Encoding value. 517 </p> 518 </td> 519</tr> 520<tr> 521<td> 522 <p> 523 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/set_content_length_impl.html" title="http::basic_fields::set_content_length_impl">set_content_length_impl</a></strong></span> 524 </p> 525 </td> 526<td> 527 <p> 528 Sets or clears the Content-Length field. 529 </p> 530 </td> 531</tr> 532<tr> 533<td> 534 <p> 535 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/set_keep_alive_impl.html" title="http::basic_fields::set_keep_alive_impl">set_keep_alive_impl</a></strong></span> 536 </p> 537 </td> 538<td> 539 <p> 540 Adjusts the Connection field. 541 </p> 542 </td> 543</tr> 544<tr> 545<td> 546 <p> 547 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/set_method_impl.html" title="http::basic_fields::set_method_impl">set_method_impl</a></strong></span> 548 </p> 549 </td> 550<td> 551 <p> 552 Set or clear the method string. 553 </p> 554 </td> 555</tr> 556<tr> 557<td> 558 <p> 559 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/set_reason_impl.html" title="http::basic_fields::set_reason_impl">set_reason_impl</a></strong></span> 560 </p> 561 </td> 562<td> 563 <p> 564 Set or clear the reason string. 565 </p> 566 </td> 567</tr> 568<tr> 569<td> 570 <p> 571 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/set_target_impl.html" title="http::basic_fields::set_target_impl">set_target_impl</a></strong></span> 572 </p> 573 </td> 574<td> 575 <p> 576 Set or clear the target string. 577 </p> 578 </td> 579</tr> 580</tbody> 581</table></div> 582<h5> 583<a name="beast.ref.boost__beast__http__fields.h4"></a> 584 <span class="phrase"><a name="beast.ref.boost__beast__http__fields.friends"></a></span><a class="link" href="boost__beast__http__fields.html#beast.ref.boost__beast__http__fields.friends">Friends</a> 585 </h5> 586<div class="informaltable"><table class="table"> 587<colgroup> 588<col> 589<col> 590</colgroup> 591<thead><tr> 592<th> 593 <p> 594 Name 595 </p> 596 </th> 597<th> 598 <p> 599 Description 600 </p> 601 </th> 602</tr></thead> 603<tbody><tr> 604<td> 605 <p> 606 <span class="bold"><strong><a class="link" href="boost__beast__http__basic_fields/swap.html" title="http::basic_fields::swap">swap</a></strong></span> 607 </p> 608 </td> 609<td> 610 <p> 611 Swap two field containers. 612 </p> 613 </td> 614</tr></tbody> 615</table></div> 616<p> 617 This container is designed to store the field value pairs that make up the 618 fields and trailers in an HTTP message. Objects of this type are iterable, 619 with each element holding the field name and field value. Field names are 620 stored as-is, but comparisons are case-insensitive. The container behaves 621 as a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">multiset</span></code>; there will be a separate value 622 for each occurrence of the same field name. When the container is iterated 623 the fields are presented in the order of insertion, with fields having the 624 same name following each other consecutively. Meets the requirements of 625 <span class="emphasis"><em>Fields</em></span> 626 </p> 627<h5> 628<a name="beast.ref.boost__beast__http__fields.h5"></a> 629 <span class="phrase"><a name="beast.ref.boost__beast__http__fields.template_parameters"></a></span><a class="link" href="boost__beast__http__fields.html#beast.ref.boost__beast__http__fields.template_parameters">Template 630 Parameters</a> 631 </h5> 632<div class="informaltable"><table class="table"> 633<colgroup> 634<col> 635<col> 636</colgroup> 637<thead><tr> 638<th> 639 <p> 640 Type 641 </p> 642 </th> 643<th> 644 <p> 645 Description 646 </p> 647 </th> 648</tr></thead> 649<tbody><tr> 650<td> 651 <p> 652 <code class="computeroutput"><span class="identifier">Allocator</span></code> 653 </p> 654 </td> 655<td> 656 <p> 657 The allocator to use. 658 </p> 659 </td> 660</tr></tbody> 661</table></div> 662<h5> 663<a name="beast.ref.boost__beast__http__fields.h6"></a> 664 <span class="phrase"><a name="beast.ref.boost__beast__http__fields.description"></a></span><a class="link" href="boost__beast__http__fields.html#beast.ref.boost__beast__http__fields.description">Description</a> 665 </h5> 666</div> 667<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 668<td align="left"></td> 669<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie 670 Falco<p> 671 Distributed under the Boost Software License, Version 1.0. (See accompanying 672 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>) 673 </p> 674</div></td> 675</tr></table> 676<hr> 677<div class="spirit-nav"> 678<a accesskey="p" href="boost__beast__http__dynamic_body.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__file_body.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> 679</div> 680</body> 681</html> 682