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 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__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">
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>
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>
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>
30 <a class="indexterm" name="idm45873491887296"></a>
31 A typical HTTP request.
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>
38 Defined in header <code class="literal"><<a href="../../../../../../boost/beast/http/message.hpp" target="_top">boost/beast/http/message.hpp</a>></code>
40 <pre class="programlisting"><span class="keyword">template</span><span class="special"><</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">></span>
43 <span class="keyword">using</span> <span class="identifier">request</span> <span class="special">=</span> <span class="identifier">message</span><span class="special"><</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">>;</span>
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>
49 <div class="informaltable"><table class="table">
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>
75 The type providing the body traits.
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>
87 The type representing the fields.
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>
99 The base class used to hold the header portion of the message.
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>
111 Indicates if the header is a request or response.
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>
121 <div class="informaltable"><table class="table">
142 <a class="link" href="boost__beast__http__message/base.html" title="http::message::base"><span class="bold"><strong>base</strong></span></a>
147 Returns the header portion of the message.
154 <a class="link" href="boost__beast__http__message/body.html" title="http::message::body"><span class="bold"><strong>body</strong></span></a>
166 <a class="link" href="boost__beast__http__message/chunked.html" title="http::message::chunked"><span class="bold"><strong>chunked</strong></span></a>
171 Returns true if the chunked Transfer-Encoding is specified.
174 Set or clear the chunked Transfer-Encoding.
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>
186 Set or clear the Content-Length field.
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>
198 Returns true if the Content-Length field is present.
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>
210 Returns true if the message semantics indicate keep-alive.
213 Set the keep-alive message semantic option.
220 <a class="link" href="boost__beast__http__message/message.html" title="http::message::message"><span class="bold"><strong>message</strong></span></a>
235 <a class="link" href="boost__beast__http__message/method.html" title="http::message::method"><span class="bold"><strong>method</strong></span></a>
240 Return the request-method verb.
243 Set the request-method.
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>
255 Return the request-method as a string.
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>
267 Returns true if the message semantics require an end of file.
274 <a class="link" href="boost__beast__http__message/operator_eq_.html" title="http::message::operator="><span class="bold"><strong>operator=</strong></span></a>
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>
291 Returns the payload size of the body in octets if possible.
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>
303 Prepare the message payload fields for the body.
310 <a class="link" href="boost__beast__http__message/reason.html" title="http::message::reason"><span class="bold"><strong>reason</strong></span></a>
315 Return the response reason-phrase.
318 Set the response reason-phrase (deprecated)
325 <a class="link" href="boost__beast__http__message/result.html" title="http::message::result"><span class="bold"><strong>result</strong></span></a>
330 The response status-code result.
333 Set the response status-code.
336 Set the response status-code as an integer.
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>
348 The response status-code expressed as an integer.
355 <a class="link" href="boost__beast__http__message/target.html" title="http::message::target"><span class="bold"><strong>target</strong></span></a>
360 Returns the request-target string.
363 Set the request-target string.
370 <a class="link" href="boost__beast__http__message/version.html" title="http::message::version"><span class="bold"><strong>version</strong></span></a>
375 Return the HTTP-version.
378 Set the HTTP-version.
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>.
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
403 <div class="informaltable"><table class="table">
424 <code class="computeroutput"><span class="identifier">isRequest</span></code>
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.
439 <code class="computeroutput"><span class="identifier">Body</span></code>
444 A type meeting the requirements of Body.
451 <code class="computeroutput"><span class="identifier">Fields</span></code>
456 The type of container used to hold the field value pairs.
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>
467 Convenience header <code class="literal"><<a href="../../../../../../boost/beast/http.hpp" target="_top">boost/beast/http.hpp</a>></code>
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 © 2016-2019 Vinnie
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>)
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>