mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-28 07:44:56 +00:00
- Introduced `dbal_commands.h` for handling DBAL operations via CLI. - Implemented `package_commands.cpp` and `package_commands.h` for package management, including listing, running scripts, and generating packages. - Created `lua_runner.cpp` and `lua_runner.h` to execute Lua scripts in a secure sandbox environment. - Added `http_client.cpp` and `http_client.h` for making HTTP requests to a specified base URL. - Updated `main.cpp` to initialize the HTTP client and dispatch commands based on user input.
27 lines
880 B
C++
27 lines
880 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;
|
|
cpr::Response put(const std::string &path,
|
|
const std::string &body,
|
|
const std::string &content_type = "application/json") const;
|
|
cpr::Response patch(const std::string &path,
|
|
const std::string &body,
|
|
const std::string &content_type = "application/json") const;
|
|
cpr::Response del(const std::string &path) const;
|
|
|
|
[[nodiscard]] const std::string &base_url() const noexcept;
|
|
|
|
private:
|
|
std::string base_url_;
|
|
};
|