boost::burl::request_head

A dynamic container for an HTTP request header.

Synopsis

class request_head
    : public request_head_base

Description

This container builds a request header in a single allocation which grows as needed, mirroring fields for the field section while adding the request line. It owns its storage and never runs out of room.

A default‐constructed object holds the default request line ("GET / HTTP/1.1") and no fields; the request line and fields are filled in through the inherited request_head_base interface. Like fields, a default‐constructed object is a non‐owning view over a shared buffer and does not allocate until it is first modified.

message_head_base::buffer returns the complete header bytes ready for the wire.

Base Classes

Name

Description

request_head_base

The header of an HTTP request.

Types

Name

Description

field_view

A view to an HTTP field.

iterator

A random‐access iterator to HTTP fields.

subrange

A forward range of values for all matching fields.

Type Aliases

Name

Description

const_iterator

A random‐access iterator to HTTP fields.

const_reverse_iterator

A reverse random‐access iterator to HTTP fields.

difference_type

The type used to represent iterator distances

reverse_iterator

A reverse random‐access iterator to HTTP fields.

size_type

The type used to represent sizes

value_type

The type of each element.

Member Functions

Name

Description

request_head [constructor]

Constructor.

~request_head [destructor]

Destructor.

operator=

Assignment.

append

append overloads

at

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

begin

Return an iterator to the beginning.

buffer

Return a string view representing the header.

capacity_in_bytes

Return the size of the storage space, in bytes.

chunked

Return true if the payload uses chunked framing.

clear

Erase all fields.

contains

Return true if a field exists.

content_length

Return the payload size stated by Content‐Length.

count

Return the number of matching fields.

empty

Return true if the container has no fields.

end

Return an iterator to the end.

erase

erase overloads

expect_100_continue

Return true if the Expect field is 100‐continue.

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 last matching element if it exists.

insert

Insert a field.

keep_alive

Return true if the connection should be kept open.

method

Return the method as a constant.

method_text

Return the method as it appears in the start line.

payload

Return the type of payload framing.

rbegin

Return a reverse iterator to the beginning.

rend

Return a reverse iterator to the end.

reserve

Reserve storage.

set

set overloads

set_chunked

Add or remove the chunked transfer coding.

set_content_length

Set the Content‐Length field.

set_expect_100_continue

Add or remove the Expect: 100‐continue field.

set_keep_alive

Set whether the connection should be kept open.

set_method

set_method overloads

set_start_line

Set the entire request line.

set_target

Set the request‐target.

set_version

Set the HTTP version.

shrink_to_fit

Remove excess capacity.

size

Return the number of fields in the container.

swap

Swap the contents.

target

Return the request‐target.

upgrade

Return true if the message proposes a protocol switch.

value_or

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

version

Return the HTTP version of the message.

Static Member Functions

Name

Description

table_space

Return the buffer space needed for a field table.

Data Members

Name

req_ [variant member]

res_ [variant member]

Static Data Members

Name

Description

buffer_alignment

The alignment an external buffer must end on.

max_buffer_size

Maximum allowed size of the storage.

max_name_size

Maximum allowed name size

max_start_line_size

Maximum allowed size of the start line

max_value_size

Maximum allowed value size

Protected Types

Protected Enums

Protected Member Functions

Protected Static Member Functions

Name

resolve_

Friends

Name

Description

boost::burl::swap

Swap the contents.

See Also

request_head_base for the request‐line observers and modifiers.

Created with MrDocs