29 lines
554 B
C
29 lines
554 B
C
|
#pragma once
|
||
|
|
||
|
#include <memory>
|
||
|
|
||
|
#include <string>
|
||
|
|
||
|
class Request : public std::enable_shared_from_this<Request> {
|
||
|
public:
|
||
|
using Ptr = std::shared_ptr<Request>;
|
||
|
|
||
|
public:
|
||
|
~Request();
|
||
|
|
||
|
static Ptr Create();
|
||
|
|
||
|
void Check();
|
||
|
|
||
|
bool Post(const std::string& url, const std::string& body, const std::string& contentType = "application/json");
|
||
|
|
||
|
const std::string GetResponseBody() const { return m_responseBody; }
|
||
|
bool IsSuccess() const { return m_success; }
|
||
|
|
||
|
protected:
|
||
|
Request() noexcept;
|
||
|
|
||
|
private:
|
||
|
std::string m_responseBody;
|
||
|
bool m_success = false;
|
||
|
};
|