1 /* 2 * Copyright (c) 2021-2022 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 "constant.h" 17 18 namespace OHOS::NetStack::Fetch { 19 const char *const FetchConstant::HTTP_METHOD_GET = "GET"; 20 const char *const FetchConstant::HTTP_METHOD_HEAD = "HEAD"; 21 const char *const FetchConstant::HTTP_METHOD_OPTIONS = "OPTIONS"; 22 const char *const FetchConstant::HTTP_METHOD_TRACE = "TRACE"; 23 const char *const FetchConstant::HTTP_METHOD_DELETE = "DELETE"; 24 const char *const FetchConstant::HTTP_METHOD_POST = "POST"; 25 const char *const FetchConstant::HTTP_METHOD_PUT = "PUT"; 26 const char *const FetchConstant::HTTP_METHOD_CONNECT = "CONNECT"; 27 28 const char *const FetchConstant::PARAM_KEY_URL = "url"; 29 const char *const FetchConstant::PARAM_KEY_METHOD = "method"; 30 const char *const FetchConstant::PARAM_KEY_DATA = "data"; 31 const char *const FetchConstant::PARAM_KEY_HEADER = "header"; 32 const char *const FetchConstant::PARAM_KEY_SUCCESS = "success"; 33 const char *const FetchConstant::PARAM_KEY_FAIL = "fail"; 34 const char *const FetchConstant::PARAM_KEY_COMPLETE = "complete"; 35 const char *const FetchConstant::PARAM_KEY_RESPONSE_TYPE = "responseType"; 36 37 const char *const FetchConstant::RESPONSE_KEY_DATA = "data"; 38 const char *const FetchConstant::RESPONSE_KEY_CODE = "code"; 39 const char *const FetchConstant::RESPONSE_KEY_HEADERS = "headers"; 40 41 const char *const FetchConstant::HTTP_URL_PARAM_START = "?"; 42 const char *const FetchConstant::HTTP_URL_PARAM_SEPARATOR = "&"; 43 const char *const FetchConstant::HTTP_URL_NAME_VALUE_SEPARATOR = "="; 44 const char *const FetchConstant::HTTP_HEADER_SEPARATOR = ":"; 45 const char *const FetchConstant::HTTP_LINE_SEPARATOR = "\r\n"; 46 47 const char *const FetchConstant::HTTP_DEFAULT_USER_AGENT = "libcurl-agent/1.0"; 48 const char *const FetchConstant::HTTP_PREPARE_CA_PATH = "/etc/security/certificates"; 49 50 const char *const FetchConstant::HTTP_CONTENT_TYPE = "content-type"; 51 const char *const FetchConstant::HTTP_CONTENT_TYPE_URL_ENCODE = "application/x-www-form-urlencoded"; 52 const char *const FetchConstant::HTTP_CONTENT_TYPE_JSON = "application/json"; 53 54 const char *const FetchConstant::HTTP_RESPONSE_TYPE_TEXT = "text"; 55 const char *const FetchConstant::HTTP_RESPONSE_TYPE_JSON = "json"; 56 } // namespace OHOS::NetStack::Fetch 57