aboutsummaryrefslogtreecommitdiff
path: root/src/http_constants.cc
blob: ecea880b093e87000f7c424dea4fa50a39eada1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2015 The Weave Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/http_constants.h"

#include <weave/enum_to_string.h>
#include <weave/provider/http_client.h>

namespace weave {
namespace http {

const char kAuthorization[] = "Authorization";
const char kContentType[] = "Content-Type";

const char kJson[] = "application/json";
const char kJsonUtf8[] = "application/json; charset=utf-8";
const char kPlain[] = "text/plain";
const char kWwwFormUrlEncoded[] = "application/x-www-form-urlencoded";

}  // namespace http

using provider::HttpClient;

namespace {

const weave::EnumToStringMap<HttpClient::Method>::Map kMapMethod[] = {
    {HttpClient::Method::kGet, "GET"},
    {HttpClient::Method::kPost, "POST"},
    {HttpClient::Method::kPut, "PUT"},
    {HttpClient::Method::kPatch, "PATCH"}};

}  // namespace

template <>
LIBWEAVE_EXPORT EnumToStringMap<HttpClient::Method>::EnumToStringMap()
    : EnumToStringMap(kMapMethod) {}

}  // namespace weave