MCPcopy Create free account
hub / github.com/apache/brpc / HttpMethod2Str

Function HttpMethod2Str

src/brpc/http_method.cpp:94–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94const char *HttpMethod2Str(HttpMethod method) {
95 pthread_once(&g_init_maps_once, BuildHttpMethodMaps);
96 if ((int)method < 0 ||
97 (int)method >= (int)ARRAY_SIZE(g_method2str_map)) {
98 return "UNKNOWN";
99 }
100 const char* s = g_method2str_map[method];
101 return s ? s : "UNKNOWN";
102}
103
104bool Str2HttpMethod(const char* method_str, HttpMethod* method) {
105 const char fc = ::toupper(*method_str);

Callers 6

MakeHttpRequestHeadersFunction · 0.85
TESTFunction · 0.85
NewMethod · 0.85
on_header_valueMethod · 0.85
http_message.cppFile · 0.85
MakeRawHttpRequestFunction · 0.85

Calls

no outgoing calls

Tested by 2

MakeHttpRequestHeadersFunction · 0.68
TESTFunction · 0.68