Beast Logo

PrevUpHomeNext

http::fields

A typical HTTP header fields container.

using fields = basic_fields< std::allocator< char >>;
Types

Name

Description

allocator_type

The type of allocator used.

const_iterator

A const iterator to the field sequence.

iterator

A const iterator to the field sequence.

value_type

The value type of the field sequence.

Member Functions

Name

Description

basic_fields

Default constructor.

Construct the fields.

Move constructor.

Copy constructor.

Construct from a field sequence.

begin

Returns a const iterator to the beginning of the field sequence.

cbegin

Returns a const iterator to the beginning of the field sequence.

cend

Returns a const iterator to the end of the field sequence.

clear

Clear the contents of the basic_fields.

count

Returns the number of values for the specified field.

empty

Returns true if the field sequence contains no elements.

end

Returns a const iterator to the end of the field sequence.

erase

Remove a field.

exists

Returns true if the specified field exists.

find

Returns an iterator to the case-insensitive matching field name.

insert

Insert a field value.

operator=

Move assignment.

Copy assignment.

operator[]

Returns the value for a case-insensitive matching header, or "".

replace

Replace a field value.

size

Returns the number of elements in the field sequence.

~basic_fields

Destructor.

This container is designed to store the field value pairs that make up the fields and trailers in a HTTP message. Objects of this type are iterable, with each element holding the field name and field value.

Field names are stored as-is, but comparisons are case-insensitive. When the container is iterated, the fields are presented in the order of insertion. For fields with the same name, the container behaves as a std::multiset; there will be a separate value for each occurrence of the field name.

Remarks

Meets the requirements of FieldSequence.

Requirements

Header: beast/http/fields.hpp

Convenience header: beast/http.hpp


PrevUpHomeNext