Beast Logo

PrevUpHomeNext

http::request_parser

An HTTP/1 parser for producing a request message.

Synopsis

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

using request_parser = parser< true, 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.

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.

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.

msesage_parser

Constructor.

need_eof

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

operator=

Copy assignment (disallowed)

parser

Constructor (default)

Copy constructor (disallowed)

Move 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.

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