Skip to content
Download

conflict

mach::conflict

Creates a Conflict response.

Creates a 409 Conflict response, optionally containing the specified value.

// (1)
template <typename T>
[[nodiscard]] mach::Reply<T> conflict(T value);
// (2)
[[nodiscard]] mach::Reply<std::string> conflict(const char* value);
// (3)
template <typename T = void>
[[nodiscard]] mach::Reply<T> conflict();

A Conflict reply containing the specified value.

A Conflict reply containing the specified string.

A Conflict reply with no value.

Parameter Description
T The type of the response body.
Parameter Description
T The reply value type used to match the endpoint’s return type. Defaults to void.
Parameter Description
value The response body.
Parameter Description
value The response body.

Overload (2) converts the specified value to a std::string.

return mach::conflict(error);
return mach::conflict("User already exists.");
return mach::conflict();
Name Description
Reply Represents the result of an HTTP endpoint.
ControllerBase::conflict Creates a Conflict response from a controller.