DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
HttpMethod.cpp
Go to the documentation of this file.
1#include "pch.h"
3
4namespace DotNetDupe {
5 namespace System {
6 namespace Net {
7 namespace Http {
8
10 const HttpMethod HttpMethod::Get("GET");
11 const HttpMethod HttpMethod::Post("POST");
12 const HttpMethod HttpMethod::Put("PUT");
13 const HttpMethod HttpMethod::Delete("DELETE");
14 const HttpMethod HttpMethod::Head("HEAD");
15 const HttpMethod HttpMethod::Options("OPTIONS");
16 const HttpMethod HttpMethod::Trace("TRACE");
17 const HttpMethod HttpMethod::Patch("PATCH");
18
19 HttpMethod::HttpMethod(const String& method) : m_sMethod(method) {
21 }
22
25 return m_sMethod;
26 }
27
30 return m_sMethod;
31 }
32
33 bool HttpMethod::Equals(const HttpMethod& other) const {
35 return m_sMethod.ToUpper() == other.m_sMethod.ToUpper();
36 }
37
38 bool HttpMethod::operator==(const HttpMethod& other) const {
40 return Equals(other);
41 }
42
43 bool HttpMethod::operator!=(const HttpMethod& other) const {
45 return !Equals(other);
46 }
47
48 }
49 }
50 }
51}
Represents standard HTTP method verbs defined in RFC 9110 and RFC 5789.
A helper class for retrieving and comparing standard HTTP methods.
Definition HttpMethod.h:19
static const HttpMethod Head
Represents an HTTP HEAD protocol method.
Definition HttpMethod.h:57
static const HttpMethod Get
Represents an HTTP GET protocol method.
Definition HttpMethod.h:49
bool operator!=(const HttpMethod &other) const
Inequality operator for HttpMethod instances.
bool Equals(const HttpMethod &other) const
Determines whether the specified HttpMethod is equal to the current HttpMethod (case-insensitive).
static const HttpMethod Trace
Represents an HTTP TRACE protocol method.
Definition HttpMethod.h:61
static const HttpMethod Put
Represents an HTTP PUT protocol method.
Definition HttpMethod.h:53
String ToString() const
Returns a string that represents the current HttpMethod object.
HttpMethod(const String &method)
Initializes a new instance of the HttpMethod class with a specific HTTP method name.
static const HttpMethod Post
Represents an HTTP POST protocol method.
Definition HttpMethod.h:51
static const HttpMethod Delete
Represents an HTTP DELETE protocol method.
Definition HttpMethod.h:55
String GetMethod() const
Gets the HTTP method verb as a string.
bool operator==(const HttpMethod &other) const
Equality operator for HttpMethod instances.
static const HttpMethod Options
Represents an HTTP OPTIONS protocol method.
Definition HttpMethod.h:59
static const HttpMethod Patch
Represents an HTTP PATCH protocol method.
Definition HttpMethod.h:63
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition String.h:74
String ToUpper() const
Definition String.cpp:680