Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Methods.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_IO_Network_HTTP_Methods_h_
5#define _Stroika_Foundation_IO_Network_HTTP_Methods_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include <string>
10
12
13/**
14 */
15
17
18 /*
19 * Standard HTTP METHODS
20 *
21 * \note https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1
22 * "The method is case-sensitive"
23 *
24 * \note https://tools.ietf.org/html/rfc5789 (for PATCH)
25 */
26 namespace Methods {
27 constexpr string_view kGet = "GET"sv;
28 constexpr string_view kPatch = "PATCH"sv;
29 constexpr string_view kPut = "PUT"sv;
30 constexpr string_view kPost = "POST"sv;
31 constexpr string_view kDelete = "DELETE"sv;
32 constexpr string_view kOptions = "OPTIONS"sv;
33 constexpr string_view kHead = "HEAD"sv;
34 }
35
36 namespace MethodsRegEx {
37 using namespace Characters;
38 // DIDNT DEFINE kANY because typically a mistake for users to be using them... Better to allow the system to handle automatically
39 //inline const RegularExpression kANY = L".*"_RegEx; /*RegularExpression::kAny*/
40 inline const RegularExpression kGet = "GET"_RegEx;
41 inline const RegularExpression kPut = "PUT"_RegEx;
42 inline const RegularExpression kPatch = "PATCH"_RegEx;
43 inline const RegularExpression kPost = "POST"_RegEx;
44 inline const RegularExpression kPostOrPut = "PUT|POST"_RegEx;
45 inline const RegularExpression kDelete = "DELETE"_RegEx;
46 inline const RegularExpression kOptions = "OPTIONS"_RegEx; // not typically used - handled automatically by webserver
47 }
48
49}
50
51/*
52 ********************************************************************************
53 ***************************** Implementation Details ***************************
54 ********************************************************************************
55 */
56#include "Methods.inl"
57
58#endif /*_Stroika_Foundation_IO_Network_HTTP_Methods_h_*/