#pragma once #include "bts_export.h" #include "lib/utils/windows_wrapper.h" #include "lib/utils/bts_no_copy.h" #include #include namespace bts { namespace utils { class BTS_EXPORT HTTPStream : public boost::asio::ip::tcp::iostream { public: HTTPStream(const std::string& host, const std::string& path, const std::string& verb="GET"); ~HTTPStream(); static const int OK = 200; int response() { return _response; } const std::map& headers() const { return _headers; } private: int _response; std::map _headers; BTS_NO_COPY(HTTPStream); }; bool download_file_if_newer(const std::string& host, const std::string& path, const std::string& destination); }}//namespace