Skip to content
Download

containsQuery

mach::Request::containsQuery

Checks whether the request contains a query parameter.

Determines whether the request contains a query parameter with the specified name.

[[nodiscard]] bool containsQuery(std::string_view name) const;

true if the request contains the specified query parameter; otherwise, false.

Parameter Description
name The name of the query parameter to check.
Exception Condition
std::bad_alloc Thrown if memory allocation fails.

Query parameter names are case-sensitive.

This function is thread-safe.

if (request().containsQuery("page")) {
// ...
}
Name Description
query Returns the value of a query parameter.
query<T> Returns a query parameter converted to a specified type.