Thoth
A functional, expressive, asynchronous C++26 webdev library
Loading...
Searching...
No Matches
MethodConcept.hpp
Go to the documentation of this file.
1#pragma once
5
6#include <string_view>
7
8
9namespace Thoth::Http {
10
18 template<class T>
19 concept MethodConcept = requires(T t, string_view body, Url url, Headers headers, StatusCodeEnum statusCode) {
20 requires requires { { T::MethodName() } -> std::same_as<string_view>; };
21
22 { T::IsSafe() } -> std::same_as<bool>;
23 { T::IsIdempotent() } -> std::same_as<bool>;
24
25 { T::ValidateRequest(body, url, headers) } -> std::same_as<WebResultOper>;
26 { T::ValidateResponse(statusCode, body, url, headers) } -> std::same_as<WebResultOper>;
27 };
28}
The HTTP methods requirements following RFC9110.
Definition MethodConcept.hpp:19
Definition Client.hpp:12
StatusCodeEnum
Definition StatusCodeEnum.hpp:7
std::string_view string_view
Definition Url.hpp:7