![]() |
boost::taar::handler::string_body_arg — Argument provider that returns the request body as a std::string.
// In header: <boost/taar/handler/rest_arg.hpp> struct string_body_arg { // public member functions template<typename... T> string_body_arg(T &&...); string_body_arg(all_content_types_t, description = {}); std::string name() const; std::string const & description() const; std::unordered_set< std::string > const & content_types() const; taar::result< std::string > operator()(boost::beast::http::request< boost::beast::http::string_body > const &, matcher::context const &) const; // public data members std::unordered_set< std::string > content_types_; std::string description_; };
By default the provider only matches requests whose Content-Type is in the list passed to the constructor (or "text/plain" if none were provided). Pass all_content_types to accept any content type. Mismatches are reported as error::invalid_content_type.
string_body_arg public member functionstemplate<typename... T> string_body_arg(T &&... args);
string_body_arg(all_content_types_t, description d = {});
std::string name() const;
std::string const & description() const;
std::unordered_set< std::string > const & content_types() const;
taar::result< std::string > operator()(boost::beast::http::request< boost::beast::http::string_body > const & request, matcher::context const &) const;