Boost C++ Libraries

PrevUpHomeNext

Struct path_arg

boost::taar::handler::path_arg — Argument provider that reads a captured path-template placeholder.

Synopsis

// In header: <boost/taar/handler/rest_arg.hpp>


struct path_arg {

  // public member functions
  path_arg(std::string, std::string = {});
  std::string const & name() const;
  std::string const & description() const;
  taar::result< std::string > 
  operator()(boost::beast::http::request_header<> const &, 
             matcher::context const &) const;

  // public data members
  std::string path_key_;
  std::string description_;
};

Description

Looks up path_key in boost::taar::matcher::context::path_args, which the target matcher populates when the request path matches its template. Reports error::argument_not_found if the key is absent.

path_arg public member functions

  1. path_arg(std::string path_key, std::string description = {});
  2. std::string const & name() const;
  3. std::string const & description() const;
  4. taar::result< std::string > 
    operator()(boost::beast::http::request_header<> const &, 
               matcher::context const & context) const;

PrevUpHomeNext