#pragma once #include #include #include #include #include #include #include namespace DB { /* Perform HTTP POST/PUT request. */ class WriteBufferFromHTTP : public WriteBufferFromOStream { private: std::unique_ptr session; Poco::Net::HTTPRequest request; Poco::Net::HTTPResponse response; public: WriteBufferFromHTTP(const Poco::URI & uri, const std::string & method = Poco::Net::HTTPRequest::HTTP_POST, // POST or PUT only const ConnectionTimeouts & timeouts = {}, size_t buffer_size_ = DBMS_DEFAULT_BUFFER_SIZE); /// Receives response from the server after sending all data. void finalize(); }; }