Nebula
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//------------------------------------------------------------------------------
17namespace Http
18{
43
44//------------------------------------------------------------------------------
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//------------------------------------------------------------------------------
67inline Util::String
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 methods enumeration (GET, PUT, etc...).
Definition httpmethod.h:20
Code
http methods
Definition httpmethod.h:24
@ Trace
Definition httpmethod.h:31
@ Delete
Definition httpmethod.h:30
@ NumHttpMethods
Definition httpmethod.h:34
@ Post
Definition httpmethod.h:28
@ InvalidHttpMethod
Definition httpmethod.h:35
@ Put
Definition httpmethod.h:29
@ Get
Definition httpmethod.h:26
@ Connect
Definition httpmethod.h:32
@ Head
Definition httpmethod.h:27
@ Options
Definition httpmethod.h:25
static Util::String ToString(Code c)
convert to string
Definition httpmethod.h:68
static Code FromString(const Util::String &str)
convert from string
Definition httpmethod.h:48
This file was generated with Nebula Trifid's idlc compiler tool.
Definition defaulthttprequesthandler.cc:15
Nebula's universal string class.
Definition string.h:50