aboutsummaryrefslogtreecommitdiffstats
path: root/include/http_request.h
diff options
context:
space:
mode:
authoripknHama <ipknhama@gmail.com>2016-09-21 23:11:06 +0900
committeripknHama <ipknhama@gmail.com>2016-09-21 23:11:06 +0900
commit3081e4e1a82a4efd8feff68850c4cc04af230cd7 (patch)
tree3ad16ef2e940abd2d47c4ac3ca224365387b7f37 /include/http_request.h
parent8b04940d2f28290451db439ad29155a0b8771ba3 (diff)
downloadcrow-3081e4e1a82a4efd8feff68850c4cc04af230cd7.tar.gz
crow-3081e4e1a82a4efd8feff68850c4cc04af230cd7.zip
Cleanup include folder into crow subfolder
- only crow.h is exposed now
Diffstat (limited to 'include/http_request.h')
-rw-r--r--include/http_request.h68
1 files changed, 0 insertions, 68 deletions
diff --git a/include/http_request.h b/include/http_request.h
deleted file mode 100644
index 535a1fd..0000000
--- a/include/http_request.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#pragma once
-
-#include "common.h"
-#include "ci_map.h"
-#include "query_string.h"
-#include <boost/asio.hpp>
-
-namespace crow
-{
- template <typename T>
- inline const std::string& get_header_value(const T& headers, const std::string& key)
- {
- if (headers.count(key))
- {
- return headers.find(key)->second;
- }
- static std::string empty;
- return empty;
- }
-
- struct DetachHelper;
-
- struct request
- {
- HTTPMethod method;
- std::string raw_url;
- std::string url;
- query_string url_params;
- ci_map headers;
- std::string body;
-
- void* middleware_context{};
- boost::asio::io_service* io_service{};
-
- request()
- : method(HTTPMethod::Get)
- {
- }
-
- request(HTTPMethod method, std::string raw_url, std::string url, query_string url_params, ci_map headers, std::string body)
- : method(method), raw_url(std::move(raw_url)), url(std::move(url)), url_params(std::move(url_params)), headers(std::move(headers)), body(std::move(body))
- {
- }
-
- void add_header(std::string key, std::string value)
- {
- headers.emplace(std::move(key), std::move(value));
- }
-
- const std::string& get_header_value(const std::string& key) const
- {
- 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);
- }
-
- };
-}