mirror of
https://github.com/ttttupup/wxhelper.git
synced 2024-07-07 06:38:16 +08:00
24 lines
570 B
C
24 lines
570 B
C
|
#ifndef WXHELPER_HTTP_CLIENT_H_
|
|||
|
#define WXHELPER_HTTP_CLIENT_H_
|
|||
|
#include "mongoose.h"
|
|||
|
#include "singleton.h"
|
|||
|
|
|||
|
namespace wxhelper {
|
|||
|
struct Data {
|
|||
|
bool done;
|
|||
|
std::string post_data;
|
|||
|
};
|
|||
|
class HttpClient : public Singleton<HttpClient> {
|
|||
|
public:
|
|||
|
void SendRequest(std::string content);
|
|||
|
void SetConfig(std::string url,uint64_t timeout);
|
|||
|
|
|||
|
static void OnHttpEvent(struct mg_connection *c, int ev, void *ev_data,
|
|||
|
void *fn_data);
|
|||
|
private:
|
|||
|
std::string url_;
|
|||
|
uint64_t timeout_;
|
|||
|
};
|
|||
|
|
|||
|
} // namespace wxhelper
|
|||
|
#endif
|