// // Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2019 // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #pragma once #include "td/net/HttpFile.h" #include "td/utils/buffer.h" #include "td/utils/common.h" #include "td/utils/Slice.h" #include "td/utils/StringBuilder.h" #include namespace td { class HttpQuery { public: enum class Type : int8 { EMPTY, GET, POST, RESPONSE }; std::vector container_; Type type_ = Type::EMPTY; MutableSlice url_path_; std::vector> args_; int code_ = 0; MutableSlice reason_; bool keep_alive_ = true; std::vector> headers_; std::vector files_; MutableSlice content_; Slice get_header(Slice key) const; MutableSlice get_arg(Slice key) const; std::vector> get_args() const; int get_retry_after() const; }; using HttpQueryPtr = unique_ptr; StringBuilder &operator<<(StringBuilder &sb, const HttpQuery &q); } // namespace td