| Home | Libraries | People | FAQ | More

#### http::message_generator

Type-erased buffers generator for `http::message` .

##### Synopsis

Defined in header `<boost/beast/http/message_generator.hpp>`

    class message_generator

##### Types

Name | Description
--- | ---
const_buffers_type |

##### Member Functions

Name | Description
--- | ---
consume | `BuffersGenerator`
is_done | `BuffersGenerator`
keep_alive | Returns the result of `m.keep_alive()` on the underlying message.
message_generator [constructor] |
prepare | `BuffersGenerator`

##### Description

Implements the BuffersGenerator concept for any concrete instance of the `http::message` template.

`http::message_generator` takes ownership of a message on construction, erasing the concrete type from the interface.

This makes it practical for use in server applications to implement request handling:

    template < class Body, class Fields>
    http::message_generator handle_request(
        string_view doc_root,
        http::request<Body, Fields>&& request);

The `beast::write` and `beast::async_write` operations are provided for BuffersGenerator. The `http::message::keep_alive` property is made available for use after writing the message.