containsQuery
mach::Request::containsQuery
Checks whether the request contains a query parameter.
Description
Section titled “Description”Determines whether the request contains a query parameter with the specified name.
Syntax
Section titled “Syntax”[[nodiscard]] bool containsQuery(std::string_view name) const;Return Value
Section titled “Return Value”true if the request contains the specified query parameter; otherwise, false.
Parameters
Section titled “Parameters”| Parameter | Description |
|---|---|
name |
The name of the query parameter to check. |
Exceptions
Section titled “Exceptions”| Exception | Condition |
|---|---|
std::bad_alloc |
Thrown if memory allocation fails. |
Remarks
Section titled “Remarks”Query parameter names are case-sensitive.
Thread Safety
Section titled “Thread Safety”This function is thread-safe.
Example
Section titled “Example”if (request().containsQuery("page")) { // ...}See Also
Section titled “See Also”| Name | Description |
|---|---|
query |
Returns the value of a query parameter. |
query<T> |
Returns a query parameter converted to a specified type. |