• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "http_constant.h"
17 
18 namespace OHOS {
19 namespace ACELite {
20 
21 const int HttpConstant::HTTP_RESPONSE_CODE_INVALID = -1;
22 
23 const char *const HttpConstant::HTTP_RESPONSE_TYPE_JSON = "json";
24 
25 const char *const HttpConstant::HTTP_HEADER_SEPARATOR = ":";
26 
27 const char *const HttpConstant::HTTP_DEFAULT_USER_AGENT = "libcurl-agent/1.0";
28 
29 const char *const HttpConstant::HTTP_DEFAULT_CONTENT_TYPE = "text/plain";
30 const char *const HttpConstant::HTTP_HEADER_KEY_CONTENT_TYPE = "content-type";
31 const char *const HttpConstant::HTTP_CONTENT_TYPE_URL_ENCODE = "application/x-www-form-urlencoded";
32 const char *const HttpConstant::HTTP_CONTENT_TYPE_JSON = "application/json";
33 
34 const char *const HttpConstant::HTTP_URL_PARAM_SEPARATOR = "?";
35 const char *const HttpConstant::HTTP_URL_PARAM_DELIMITER = "&";
36 
37 const char *const HttpConstant::HTTP_METHOD_GET = "GET";
38 const char *const HttpConstant::HTTP_METHOD_HEAD = "HEAD";
39 const char *const HttpConstant::HTTP_METHOD_OPTIONS = "OPTIONS";
40 const char *const HttpConstant::HTTP_METHOD_TRACE = "TRACE";
41 const char *const HttpConstant::HTTP_METHOD_DELETE = "DELETE";
42 const char *const HttpConstant::HTTP_METHOD_POST = "POST";
43 const char *const HttpConstant::HTTP_METHOD_PUT = "PUT";
44 
45 const char *const HttpConstant::KEY_HTTP_RESPONSE_CODE = "code";
46 const char *const HttpConstant::KEY_HTTP_RESPONSE_DATA = "data";
47 const char *const HttpConstant::KEY_HTTP_RESPONSE_HEADERS = "headers";
48 
49 const char *const HttpConstant::KEY_HTTP_REQUEST_URL = "url";
50 const char *const HttpConstant::KEY_HTTP_REQUEST_DATA = "data";
51 const char *const HttpConstant::KEY_HTTP_REQUEST_HEADER = "header";
52 const char *const HttpConstant::KEY_HTTP_REQUEST_METHOD = "method";
53 const char *const HttpConstant::KEY_HTTP_REQUEST_RESPONSE_TYPE = "responseType";
54 
55 } // namespace ACELite
56 } // namespace OHOS