Files
metabuilder/frontends/cli/src/utils/http_client.h
johndoe6345789 3d2fc07026 feat(cli): add DBAL command handlers and package management functionality
- 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.
2026-01-07 15:28:19 +00:00

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_;
};