add http_client library, using libcurl
take out common http entities to http_common dir
This commit is contained in:
@@ -10,11 +10,11 @@ public:
|
||||
PIHTTPServer();
|
||||
virtual ~PIHTTPServer();
|
||||
|
||||
using RequestFunction = std::function<MicrohttpdServer::Reply(const MicrohttpdServer::Request &)>;
|
||||
using RequestFunction = std::function<PIHTTP::MessageMutable(const PIHTTP::MessageConst &)>;
|
||||
|
||||
void registerPath(const PIString & path, MicrohttpdServer::Method method, RequestFunction functor);
|
||||
void registerPath(const PIString & path, PIHTTP::Method method, RequestFunction functor);
|
||||
void registerUnhandled(RequestFunction functor);
|
||||
void unregisterPath(const PIString & path, MicrohttpdServer::Method method);
|
||||
void unregisterPath(const PIString & path, PIHTTP::Method method);
|
||||
void unregisterPath(const PIString & path);
|
||||
|
||||
void addReplyHeader(const PIString & name, const PIString & value) { reply_headers[name] = value; }
|
||||
@@ -25,7 +25,7 @@ private:
|
||||
struct Endpoint {
|
||||
bool match(const PIStringList & in_path) const;
|
||||
PIStringList path;
|
||||
MicrohttpdServer::Method method = MicrohttpdServer::Method::Unknown;
|
||||
PIHTTP::Method method = PIHTTP::Method::Unknown;
|
||||
RequestFunction function;
|
||||
};
|
||||
PIMap<PIString, PIString> reply_headers;
|
||||
|
||||
Reference in New Issue
Block a user