Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
httpmethod.h
Go to the documentation of this file.
1
#pragma once
2
#ifndef HTTP_HTTPMETHOD_H
3
#define HTTP_HTTPMETHOD_H
4
//------------------------------------------------------------------------------
14
#include "
util/string.h
"
15
16
//------------------------------------------------------------------------------
17
namespace
Http
18
{
19
class
HttpMethod
20
{
21
public
:
23
enum
Code
24
{
25
Options
,
26
Get
,
27
Head
,
28
Post
,
29
Put
,
30
Delete
,
31
Trace
,
32
Connect
,
33
34
NumHttpMethods
,
35
InvalidHttpMethod
,
36
};
37
39
static
Code
FromString
(
const
Util::String
& str);
41
static
Util::String
ToString
(
Code
c);
42
};
43
44
//------------------------------------------------------------------------------
47
inline
HttpMethod::Code
48
HttpMethod::FromString
(
const
Util::String
& str)
49
{
50
if
(str ==
"OPTIONS"
)
return
Options
;
51
else
if
(str ==
"GET"
)
return
Get
;
52
else
if
(str ==
"HEAD"
)
return
Head
;
53
else
if
(str ==
"POST"
)
return
Post
;
54
else
if
(str ==
"PUT"
)
return
Put
;
55
else
if
(str ==
"DELETE"
)
return
Delete
;
56
else
if
(str ==
"TRACE"
)
return
Trace
;
57
else
if
(str ==
"CONNECT"
)
return
Connect
;
58
else
59
{
60
return
InvalidHttpMethod
;
61
}
62
}
63
64
//------------------------------------------------------------------------------
67
inline
Util::String
68
HttpMethod::ToString
(
Code
c)
69
{
70
switch
(c)
71
{
72
case
Options
:
return
"OPTIONS"
;
73
case
Get
:
return
"GET"
;
74
case
Head
:
return
"HEAD"
;
75
case
Post
:
return
"POST"
;
76
case
Put
:
return
"PUT"
;
77
case
Delete
:
return
"DELETE"
;
78
case
Trace
:
return
"TRACE"
;
79
case
Connect
:
return
"CONNECT"
;
80
default
:
81
return
"InvalidHttpMethod"
;
82
}
83
}
84
85
}
// namespace Http
86
//------------------------------------------------------------------------------
87
#endif
88
Http::HttpMethod
Http methods enumeration (GET, PUT, etc...).
Definition
httpmethod.h:20
Http::HttpMethod::Code
Code
http methods
Definition
httpmethod.h:24
Http::HttpMethod::Trace
@ Trace
Definition
httpmethod.h:31
Http::HttpMethod::Delete
@ Delete
Definition
httpmethod.h:30
Http::HttpMethod::NumHttpMethods
@ NumHttpMethods
Definition
httpmethod.h:34
Http::HttpMethod::Post
@ Post
Definition
httpmethod.h:28
Http::HttpMethod::InvalidHttpMethod
@ InvalidHttpMethod
Definition
httpmethod.h:35
Http::HttpMethod::Put
@ Put
Definition
httpmethod.h:29
Http::HttpMethod::Get
@ Get
Definition
httpmethod.h:26
Http::HttpMethod::Connect
@ Connect
Definition
httpmethod.h:32
Http::HttpMethod::Head
@ Head
Definition
httpmethod.h:27
Http::HttpMethod::ToString
static Util::String ToString(Code c)
convert to string
Definition
httpmethod.h:68
Http::HttpMethod::FromString
static Code FromString(const Util::String &str)
convert from string
Definition
httpmethod.h:48
Http
This file was generated with Nebula Trifid's idlc compiler tool.
Definition
defaulthttprequesthandler.cc:15
Options
Globally accessible options.
Definition
options.cc:7
string.h
Util.String
Nebula's universal string class.
Definition
String.cs:8
code
foundation
http
httpmethod.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.