More HttPony integration

parent bc899847
......@@ -90,6 +90,8 @@ add_subdirectory(lib/Melanolib/src EXCLUDE_FROM_ALL)
include_directories(${CMAKE_SOURCE_DIR}/lib/HttPony/include)
set(BUILD_SHARED_MELANO_LIBS ON)
set(HTTPONY_SHARED ON)
add_subdirectory(lib/HttPony EXCLUDE_FROM_ALL)
add_subdirectory(modules lib)
......
Subproject commit 784eb2f1b62d87511ae4ff12860475a176f9ca32
Subproject commit f43fc514f6ca2cb3e50dde638208f8547f0db8b7
Subproject commit a181f7c02157c23d4fb9fa5f5cdf6088e3c3aa68
Subproject commit bee077b8ac033b3fe948f1d53031756d12e3fe74
......@@ -60,6 +60,8 @@ void HttpClient::on_response(Request& request, Response& response)
void HttpClient::process_request(Request& request)
{
/// \todo Implement Transfer-encoding and switch to 1.1
// request.protocol = httpony::Protocol::http_1_0;
ParentClient::process_request(request);
Log("web",'<') << request.method << ' ' << request.uri.full();
}
......
......@@ -289,7 +289,7 @@ protected:
bool on_handle(network::Message& msg) override
{
std::string url = "http://api.urbandictionary.com/v0/define";
request_json(msg, web::Request("GET", {url, {{"term",msg.message}}}));
request_json(msg, web::Request("GET", {url, {{"term", msg.message}}}));
return true;
}
......
......@@ -94,7 +94,7 @@ protected:
Settings ptree;
JsonParser parser;
try {
ptree = parser.parse(response.body, request.uri.full());
ptree = parser.parse_string(response.body.read_all(), request.uri.full());
json_success(msg,ptree);
} catch ( const JsonError& err ) {
ErrorLog errlog("web","JSON Error");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment