it complies and crow updated

This commit is contained in:
moneroexamples 2016-09-06 18:34:07 +08:00
parent 9b3a27baa9
commit f9925d6c3b
20 changed files with 870 additions and 513 deletions

18
ext/crow/http_request.h Normal file → Executable file
View file

@ -3,6 +3,7 @@
#include "common.h"
#include "ci_map.h"
#include "query_string.h"
#include <boost/asio.hpp>
namespace crow
{
@ -17,6 +18,8 @@ namespace crow
return empty;
}
struct DetachHelper;
struct request
{
HTTPMethod method;
@ -27,9 +30,10 @@ namespace crow
std::string body;
void* middleware_context{};
boost::asio::io_service* io_service{};
request()
: method(HTTPMethod::GET)
: method(HTTPMethod::Get)
{
}
@ -48,5 +52,17 @@ namespace crow
return crow::get_header_value(headers, key);
}
template<typename CompletionHandler>
void post(CompletionHandler handler)
{
io_service->post(handler);
}
template<typename CompletionHandler>
void dispatch(CompletionHandler handler)
{
io_service->dispatch(handler);
}
};
}