proxygen
HTTPMethod.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 #pragma once
11 
12 #include <folly/Optional.h>
13 #include <folly/Range.h>
14 #include <string>
15 
16 namespace proxygen {
17 
18 // Ordered by frequency to minimize time spent in iteration
19 #define HTTP_METHOD_GEN(x) \
20  x(GET), \
21  x(POST), \
22  x(OPTIONS), \
23  x(DELETE), \
24  x(HEAD), \
25  x(CONNECT), \
26  x(PUT), \
27  x(TRACE), \
28  x(PATCH), \
29  x(SUB), \
30  x(PUB), \
31  x(UNSUB)
32 
33 
34 #define HTTP_METHOD_ENUM(method) method
35 
42 enum class HTTPMethod {
44 };
45 
46 #undef HTTP_METHOD_ENUM
47 
55 
60 extern const std::string& methodToString(HTTPMethod method);
61 
62 std::ostream& operator<<(std::ostream& os, HTTPMethod method);
63 
64 }
folly::Optional< HTTPMethod > stringToMethod(folly::StringPiece method)
Definition: HTTPMethod.cpp:37
std::ostream & operator<<(std::ostream &os, const HeaderTable &table)
#define HTTP_METHOD_GEN(x)
Definition: HTTPMethod.h:19
const std::string & methodToString(HTTPMethod method)
Definition: HTTPMethod.cpp:46
#define HTTP_METHOD_ENUM(method)
Definition: HTTPMethod.h:34
const char * string
Definition: Conv.cpp:212