30 lines
589 B
C++
30 lines
589 B
C++
#pragma once
|
|
|
|
#include <functional>
|
|
|
|
namespace acs
|
|
{
|
|
class http_client;
|
|
|
|
class request_delegate
|
|
{
|
|
http_client* client_ = nullptr;
|
|
|
|
static constexpr auto host = "api.cismon.net";
|
|
|
|
static constexpr auto query = "/client/1/testacsclient";
|
|
|
|
using callback_t = std::function<void(const std::pair<std::string, std::string>&)>;
|
|
|
|
callback_t callback_;
|
|
|
|
void response_handler(const std::string& response_body) const;
|
|
|
|
public:
|
|
|
|
explicit request_delegate() = default;
|
|
|
|
void execute(const callback_t& callback);
|
|
};
|
|
}
|