/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef UPLOAD_CONFIG #define UPLOAD_CONFIG #include #include #include #include "curl/curl.h" namespace OHOS::Request::Upload { struct File { std::string filename; std::string name; std::string uri; std::string type; }; struct RequestData { std::string name; std::string value; }; struct UploadResponse { int32_t code; std::string data; std::string headers; }; struct UploadConfig { std::string url; std::map header; std::string method; std::vector files; std::vector data; std::function fsuccess; std::function ffail; std::function fcomplete; std::string protocolVersion; }; class CUrlAdp; struct FileData { FILE *fp; std::string filename; std::string name; std::string type; std::shared_ptr adp; int64_t upsize; int64_t totalsize; uint32_t fileIndex; struct curl_slist *list; std::vector responseHead; int32_t headSendFlag; int32_t httpCode; uint32_t result; }; } // namespace OHOS::Request::Upload #endif