1 // Copyright 2015 The Weave Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "src/http_constants.h" 6 7 #include <weave/enum_to_string.h> 8 #include <weave/provider/http_client.h> 9 10 namespace weave { 11 namespace http { 12 13 const char kAuthorization[] = "Authorization"; 14 const char kContentType[] = "Content-Type"; 15 16 const char kJson[] = "application/json"; 17 const char kJsonUtf8[] = "application/json; charset=utf-8"; 18 const char kPlain[] = "text/plain"; 19 const char kWwwFormUrlEncoded[] = "application/x-www-form-urlencoded"; 20 21 } // namespace http 22 23 using provider::HttpClient; 24 25 namespace { 26 27 const weave::EnumToStringMap<HttpClient::Method>::Map kMapMethod[] = { 28 {HttpClient::Method::kGet, "GET"}, 29 {HttpClient::Method::kPost, "POST"}, 30 {HttpClient::Method::kPut, "PUT"}, 31 {HttpClient::Method::kPatch, "PATCH"}}; 32 33 } // namespace 34 35 template <> EnumToStringMap()36LIBWEAVE_EXPORT EnumToStringMap<HttpClient::Method>::EnumToStringMap() 37 : EnumToStringMap(kMapMethod) {} 38 39 } // namespace weave 40