23 template <
typename Mapper>
24 static auto parse_http_request(
const std::string& request, Mapper&& mapper)
27 std::string_view path;
28 std::string_view queries;
30 auto idx = request.find_first_of(
'?');
31 if(idx != std::string::npos)
33 path = std::string_view(request.data(), idx);
34 queries = std::string_view(request.data() + idx + 1, request.size() - idx);
41 std::string clean_path;
42 ossia::net::url_decode(path, clean_path);
43 return mapper(clean_path, parse_http_methods(queries));
46 static string_map<std::string> parse_http_methods(std::string_view str);
48 static bool parse_bool(
const std::string& data);
55 net::repetition_filter_attribute,
const std::string& data,
58 net::refresh_rate_attribute attr,
const std::string& data,
63 net::value_step_size_attribute attr,
const std::string& data,
72 net::description_attribute attr,
const std::string& data,
77 net::app_version_attribute attr,
const std::string& data,
80 net::app_creator_attribute attr,
const std::string& data,
89 net::instance_bounds_attribute attr,
const std::string& data,
94 net::extended_type_attribute attr,
const std::string& data,
97 net::default_value_attribute attr,
const std::string& data,
100 oscquery::detail::typetag_attribute attr,
const std::string& data,