boost::http_proto::response_view

A view to a valid HTTP response.

Synopsis

class response_view
    : public message_view_base;

Base Classes

Name

Description

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

response_view [constructor]

Constructor.

~response_view [destructor]

Destructor

operator=

Assignment.

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.

chunked

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

count

Return the number of matching fields.

end

Return an iterator to the end.

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.

keep_alive

Return true if semantics indicate connection persistence.

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.

reason

Return the reason string

rend

Return a reverse iterator to the end.

size

Return the number of fields in the container.

status

Return the status code.

status_int

Return the status code integer.

swap

Swap.

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::swap

Swap.

boost::http_proto::response_parser

A parser for HTTP/1 responses.

boost::http_proto::response_base

Mixin for modifiing HTTP responses.

Description

Objects of this type represent a view to a HTTP response container. That is, it acts like a core::string_view in terms of ownership. The caller is responsible for ensuring that the lifetime of the underlying buffer extends until it is no longer referenced.

See Also