mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-05 19:19:35 +00:00
20 lines
454 B
C++
20 lines
454 B
C++
#pragma once
|
|
|
|
#include <cpr/cpr.h>
|
|
#include <string>
|
|
|
|
class HttpClient {
|
|
public:
|
|
explicit HttpClient(std::string base_url);
|
|
|
|
cpr::Response get(const std::string &path) const;
|
|
cpr::Response post(const std::string &path,
|
|
const std::string &body,
|
|
const std::string &content_type = "application/json") const;
|
|
|
|
[[nodiscard]] const std::string &base_url() const noexcept;
|
|
|
|
private:
|
|
std::string base_url_;
|
|
};
|