lokinet/libabyss/include/abyss/http.hpp

40 lines
736 B
C++
Raw Normal View History

#ifndef ABYSS_HTTP_HPP
#define ABYSS_HTTP_HPP
2019-02-15 23:04:04 +00:00
#include <util/json.hpp>
#include <util/string_view.hpp>
2018-11-01 12:47:14 +00:00
#include <string>
#include <unordered_map>
namespace abyss
{
namespace http
{
struct RequestHeader
{
using Headers_t = std::unordered_multimap<std::string, std::string>;
2018-11-01 12:47:14 +00:00
Headers_t Headers;
std::string Method;
std::string Path;
};
struct HeaderReader
{
2019-02-15 23:04:04 +00:00
using string_view = llarp::string_view;
2018-11-01 12:47:14 +00:00
RequestHeader Header;
virtual ~HeaderReader()
{
}
bool
2019-02-15 23:04:04 +00:00
ProcessHeaderLine(string_view line, bool& done);
2018-11-01 12:47:14 +00:00
virtual bool
2019-02-15 23:04:04 +00:00
ShouldProcessHeader(const string_view& line) const = 0;
2018-11-01 12:47:14 +00:00
};
} // namespace http
} // namespace abyss
#endif