boost::http_proto::message_base

Mixin for modifiing common metadata in HTTP request and response messages.

Synopsis

class message_base
    : public fields_base
    , public message_view_base;

Base Classes

Name

Description

fields_base

Mixin for modifiable HTTP fields.

message_view_base

Provides read‐only access to common metadata in HTTP request and response messages.

Types

Name

Description

iterator

A bidirectional iterator to HTTP fields.

reference

A view to an HTTP field.

reverse_iterator

A bidirectional reverse iterator to HTTP fields.

subrange

A forward range of matching fields.

value_type

A value type which represent an HTTP field.

const_iterator

A bidirectional iterator to HTTP fields.

const_reference

A view to an HTTP field.

const_reverse_iterator

A bidirectional iterator to HTTP fields.

Member Functions

Name

Description

append

Append a header.

at

Return the value of a field, or throws an exception.

begin

Return an iterator to the beginning.

buffer

Return a string view representing the serialized data.

capacity_in_bytes

Return the total number of bytes allocated by the container.

chunked

Return true if the message is using a chunked transfer encoding.

clear

Clear contents while preserving the capacity.

count

Return the number of matching fields.

end

Return an iterator to the end.

erase

erase overloads

exists

Return true if a field exists.

find

Return an iterator to the matching element if it exists.

find_all

Return a forward range containing values for all matching fields.

find_last

Return an iterator to the matching element if it exists.

insert

Insert a header.

keep_alive

Return true if semantics indicate connection persistence.

max_capacity_in_bytes

Return the maximum allowed capacity in bytes.

metadata

Return metadata about the message.

payload

Return the type of payload of this message.

payload_size

Return the payload size.

rbegin

Return a reverse iterator to the beginning.

rend

Return a reverse iterator to the end.

reserve_bytes

Adjust the capacity without changing the size.

set

Set a header value.

set_chunked

Set whether the payload is chunked.

set_content_length

Set the Content‐Length to the specified value.

set_keep_alive

Set whether the connection should stay open.

set_max_capacity_in_bytes

Set the maximum allowed capacity in bytes.

set_payload_size

Set the payload size.

shrink_to_fit

Remove excess capacity.

size

Return the number of fields in the container.

value_or

Return the value of a field or a default if missing.

version

Return the HTTP‐version.

Static Member Functions

Name

Description

max_size

Return the largest possible serialized message.

Friends

Name

Description

boost::http_proto::response_base

Mixin for modifiing HTTP responses.

boost::http_proto::request_base

Mixin for modifiing HTTP requests.

Derived Classes

Name

Description

request_base

Mixin for modifiing HTTP requests.

response_base

Mixin for modifiing HTTP responses.

Description

This type is useful for modifying common properties shared by both requests and responses.