mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 05:22:17 +00:00
b6e205dcdf
* initial commit. integ tests passing, need to re-run unit & my own personal tests * partial refactoring to remove Protocol::ANY * improve naming * remove all usages of ProxyConfiguration::Protocol::ANY * fix ut * blabla * support url functions as well * support for HTTPS requests over HTTP proxy with tunneling off * remove gtestabc * fix silly mistake * ... * remove usages of httpclientsession::proxyconfig in src/ * got you * remove stale comment * it seems like I need reasonable defaults * fix ut * add some comments * remove no longer needed header * matrix out * add https over http proxy with no tunneling * soem docs * partial refactoring * rename to use_tunneling_for_https_requests_over_http_proxy * improve docs * use shorter version * remove useless test * rename the setting * update * fix typo * fix setting docs typo * move ); up * move ) up
41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include <IO/ConnectionTimeouts.h>
|
|
#include <IO/WriteBuffer.h>
|
|
#include <IO/WriteBufferFromOStream.h>
|
|
#include <IO/HTTPCommon.h>
|
|
#include <IO/HTTPHeaderEntries.h>
|
|
#include <Poco/Net/HTTPClientSession.h>
|
|
#include <Poco/Net/HTTPRequest.h>
|
|
#include <Poco/Net/HTTPResponse.h>
|
|
#include <Poco/URI.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/* Perform HTTP POST/PUT request.
|
|
*/
|
|
class WriteBufferFromHTTP : public WriteBufferFromOStream
|
|
{
|
|
public:
|
|
explicit WriteBufferFromHTTP(const Poco::URI & uri,
|
|
const std::string & method = Poco::Net::HTTPRequest::HTTP_POST, // POST or PUT only
|
|
const std::string & content_type = "",
|
|
const std::string & content_encoding = "",
|
|
const HTTPHeaderEntries & additional_headers = {},
|
|
const ConnectionTimeouts & timeouts = {},
|
|
size_t buffer_size_ = DBMS_DEFAULT_BUFFER_SIZE,
|
|
ProxyConfiguration proxy_configuration = {});
|
|
|
|
private:
|
|
/// Receives response from the server after sending all data.
|
|
void finalizeImpl() override;
|
|
|
|
HTTPSessionPtr session;
|
|
Poco::Net::HTTPRequest request;
|
|
Poco::Net::HTTPResponse response;
|
|
};
|
|
|
|
}
|