mirror of
https://github.com/sebastiandine/Card-Collection-Manager-3.git
synced 2026-09-03 17:01:03 +00:00
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>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user