![]() |
boost::taar::handler::header_arg — Argument provider that reads a request header.
// In header: <boost/taar/handler/rest_arg.hpp> struct header_arg { // public member functions header_arg(std::string, std::string = {}); header_arg(boost::beast::http::field, std::string = {}); std::string const & description() const; std::string name() const; taar::result< std::string > operator()(boost::beast::http::request_header<> const &, matcher::context const &) const; // public data members std::variant< boost::beast::http::field, std::string > header_; std::string description_; };
Accepts either a boost::beast::http::field constant for well-known headers or a raw string name. If the same header is present more than once with conflicting values the provider reports error::argument_ambiguous.
header_arg public member functionsheader_arg(std::string header_name, std::string description = {});
header_arg(boost::beast::http::field field, std::string description = {});
std::string const & description() const;
std::string name() const;
taar::result< std::string > operator()(boost::beast::http::request_header<> const & request, matcher::context const &) const;