Files
Card-Collection-Manager-3-s…/core/include/ccm/ports/IHttpClient.hpp
T
Sebastian Dine 55ace147bc major: initial release
* initial development

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* pipeline

* ci/cd

* ci/cd

* ci/cd

* ci/cd

* ci/cd

* ci/cd

* ci/cd

* pokemon

* pokemon

* pokemon

* pokemon

* pokemon

* pokemon

* improvements

* improvements

* ci/cd

* ci/cd

* improvements

* improvements

* improvements

* improvements

* improvements

* improvements

* improvements

* improvements

* improvements

---------

Co-authored-by: sdine <sdine@sdine.com>
2026-05-09 11:05:47 +02:00

27 lines
774 B
C++

#pragma once
// IHttpClient - tiny abstraction over HTTP GET so the rest of the codebase
// never sees libcurl/cpr directly. Tests can substitute a fake client.
#include "ccm/util/Result.hpp"
#include <string>
#include <string_view>
namespace ccm {
class IHttpClient {
public:
virtual ~IHttpClient() = default;
// Issue a blocking HTTPS GET. Returns the response body on success, an
// error string on failure (no exceptions across the port boundary).
//
// The returned `std::string` is a raw byte buffer - it is NOT decoded as
// text. Binary payloads (e.g. PNG/JPEG image bytes for the card preview
// feature) round-trip through this method intact.
virtual Result<std::string> get(std::string_view url) = 0;
};
} // namespace ccm