Beast Logo

PrevUpHomeNext

http::response_parser

An HTTP/1 parser for producing a response message.

Synopsis

Defined in header <beast/http/parser.hpp>

using response_parser = parser< false, Body, Allocator >;
Types

Name

Description

is_request

true if this parser parses requests, false for responses.

value_type

The type of message returned by the parser.

Member Functions

Name

Description

base

Returns a reference to this object as a basic_parser.

Returns a constant reference to this object as a basic_parser.

body_limit

Set the limit on the payload body.

content_length

Returns the optional value of Content-Length if known.

eager

Returns true if the eager parse option is set.

Set the eager parse option.

get

Returns the parsed message.

got_some

Returns true if the parser has received at least one byte of input.

header_limit

Set a limit on the total size of the header.

is_chunked

Returns true if the last value for Transfer-Encoding is "chunked".

is_done

Returns true if the message is complete.

is_header_done

Returns true if a the parser has produced the full header.

is_keep_alive

Returns true if the message has keep-alive connection semantics.

is_upgrade

Returns true if the message is an upgrade message.

need_eof

Returns true if the message semantics require an end of file.

on_chunk_body

Set a callback to be invoked on chunk body data.

on_chunk_header

Set a callback to be invoked on each chunk header.

operator=

Assignment.

parser

Constructor.

Construct a parser from another parser, changing the Body type.

put

Write a buffer sequence to the parser.

put_eof

Inform the parser that the end of stream was reached.

release

Returns ownership of the parsed message.

skip

Returns true if the skip parse option is set.

Set the skip parse option.

~parser

Destructor.

This class uses the basic HTTP/1 wire format parser to convert a series of octets into a http::message using the http::basic_fields container to represent the fields.

Template Parameters

Type

Description

isRequest

Indicates whether a request or response will be parsed.

Body

The type used to represent the body. This must meet the requirements of Body.

Allocator

The type of allocator used with the basic_fields container.

Remarks

A new instance of the parser is required for each message.

Convenience header <beast/http.hpp>


PrevUpHomeNext