Vitaly Buka | 4615e0d | 2015-10-14 15:35:12 -0700 | [diff] [blame] | 1 | // Copyright 2015 The Weave Authors. All rights reserved. |
Vitaly Buka | 1da6599 | 2015-08-06 01:38:57 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Stefan Sauer | 2d16dfa | 2015-09-25 17:08:35 +0200 | [diff] [blame] | 5 | #include "src/http_constants.h" |
Vitaly Buka | 1da6599 | 2015-08-06 01:38:57 -0700 | [diff] [blame] | 6 | |
Vitaly Buka | 1a42e14 | 2015-10-10 18:15:15 -0700 | [diff] [blame] | 7 | #include <weave/enum_to_string.h> |
Vitaly Buka | 96cc933 | 2015-10-10 18:19:57 -0700 | [diff] [blame] | 8 | #include <weave/provider/http_client.h> |
Vitaly Buka | 1a42e14 | 2015-10-10 18:15:15 -0700 | [diff] [blame] | 9 | |
Vitaly Buka | 1da6599 | 2015-08-06 01:38:57 -0700 | [diff] [blame] | 10 | namespace weave { |
| 11 | namespace http { |
| 12 | |
Vitaly Buka | 1da6599 | 2015-08-06 01:38:57 -0700 | [diff] [blame] | 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 |
Vitaly Buka | 1a42e14 | 2015-10-10 18:15:15 -0700 | [diff] [blame] | 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 <> |
| 36 | LIBWEAVE_EXPORT EnumToStringMap<HttpClient::Method>::EnumToStringMap() |
| 37 | : EnumToStringMap(kMapMethod) {} |
| 38 | |
Vitaly Buka | 1da6599 | 2015-08-06 01:38:57 -0700 | [diff] [blame] | 39 | } // namespace weave |