blob: ecea880b093e87000f7c424dea4fa50a39eada1d [file] [log] [blame]
Vitaly Buka4615e0d2015-10-14 15:35:12 -07001// Copyright 2015 The Weave Authors. All rights reserved.
Vitaly Buka1da65992015-08-06 01:38:57 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Stefan Sauer2d16dfa2015-09-25 17:08:35 +02005#include "src/http_constants.h"
Vitaly Buka1da65992015-08-06 01:38:57 -07006
Vitaly Buka1a42e142015-10-10 18:15:15 -07007#include <weave/enum_to_string.h>
Vitaly Buka96cc9332015-10-10 18:19:57 -07008#include <weave/provider/http_client.h>
Vitaly Buka1a42e142015-10-10 18:15:15 -07009
Vitaly Buka1da65992015-08-06 01:38:57 -070010namespace weave {
11namespace http {
12
Vitaly Buka1da65992015-08-06 01:38:57 -070013const char kAuthorization[] = "Authorization";
14const char kContentType[] = "Content-Type";
15
16const char kJson[] = "application/json";
17const char kJsonUtf8[] = "application/json; charset=utf-8";
18const char kPlain[] = "text/plain";
19const char kWwwFormUrlEncoded[] = "application/x-www-form-urlencoded";
20
21} // namespace http
Vitaly Buka1a42e142015-10-10 18:15:15 -070022
23using provider::HttpClient;
24
25namespace {
26
27const 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
35template <>
36LIBWEAVE_EXPORT EnumToStringMap<HttpClient::Method>::EnumToStringMap()
37 : EnumToStringMap(kMapMethod) {}
38
Vitaly Buka1da65992015-08-06 01:38:57 -070039} // namespace weave