ClickHouse/dbms/include/DB/Common/HTMLForm.h

27 lines
591 B
C++
Raw Normal View History

2015-10-05 01:26:43 +00:00
#pragma once
#include <sstream>
#include <Poco/Net/HTMLForm.h>
#include <Poco/Net/HTTPRequest.h>
#include <Poco/URI.h>
/** Somehow, in case of POST, Poco::Net::HTMLForm doesn't read parameters from URL, only from body.
* This helper allows to read parameters just from URL.
*/
2015-10-05 01:26:43 +00:00
struct HTMLForm : public Poco::Net::HTMLForm
{
HTMLForm(const Poco::Net::HTTPRequest & request)
2015-10-05 01:26:43 +00:00
{
Poco::URI uri(request.getURI());
std::istringstream istr(uri.getRawQuery());
readUrl(istr);
}
HTMLForm(const Poco::URI & uri)
2015-10-05 01:26:43 +00:00
{
std::istringstream istr(uri.getRawQuery());
readUrl(istr);
}
};