Example #1
0
NamesAndTypesList NamesAndTypesList::parse(const String & s)
{
    ReadBufferFromString in(s);
    NamesAndTypesList res;
    res.readText(in);
    assertEOF(in);
    return res;
}
bool Client::executeQuery(const InterserverIOEndpointLocation & location, const std::string & query)
{
	ReadBufferFromHTTP::Params params =
	{
		{"endpoint", getEndpointId(location.name)},
		{"compress", "false"},
		{"query", query}
	};

	ReadBufferFromHTTP in{location.host, location.port, params};

	bool flag;
	readBinary(flag, in);
	assertEOF(in);

	return flag;
}
bool Client::executeQuery(const InterserverIOEndpointLocation & location, const std::string & query)
{
    Poco::URI uri;
    uri.setScheme("http");
    uri.setHost(location.host);
    uri.setPort(location.port);
    uri.setQueryParameters(
    {
        {"endpoint", getEndpointId(location.name)},
        {"compress", "false"},
        {"query", query}
    });

    ReadWriteBufferFromHTTP in{uri, Poco::Net::HTTPRequest::HTTP_POST};

    bool flag;
    readBinary(flag, in);
    assertEOF(in);

    return flag;
}