...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Write a complete message to a stream.
Defined in header <boost/beast/http/write.hpp>
template< class SyncWriteStream, bool isRequest, class Body, class Fields> std::size_t write( SyncWriteStream& stream, message< isRequest, Body, Fields >& msg);
This function is used to write a complete message to a stream using HTTP/1. The call will block until one of the following conditions is true:
This operation is implemented in terms of one or more calls to the stream's
write_some
function. The
algorithm will use a temporary serializer
with an empty chunk
decorator to produce buffers.
This function only participates in overload resolution if is_mutable_body_writer
for Body
returns true
.
Name |
Description |
---|---|
|
The stream to which the data is to be written. The type must support the SyncWriteStream concept. |
|
The message to write. |
The number of bytes written to the stream.
Type |
Thrown On |
---|---|
|
Thrown on failure. |