#pragma once // Spec: SPEC.md FR-NET-01. Plain data describing one HTTP exchange. #include #include #include #include #include #include #include #include "core/Result.hpp" namespace dp { struct HttpRequest { std::string method = "GET"; // Relative to spec::NetLimits::kBaseUrl unless it starts with http:// or https://. std::string path; std::vector> query; std::vector> headers; std::string body; std::string contentType; double timeoutSeconds = 0.0; // 0 = spec default int maxRetries = -1; // -1 = spec default for the method (GET only) std::size_t maxResponseBytes = 0; // 0 = spec default }; struct HttpResponse { int status = 0; std::string body; std::string contentType; }; class CancelToken { public: void cancel() { cancelled_.store(true); } bool cancelled() const { return cancelled_.load(); } private: std::atomic cancelled_{false}; }; using CancelPtr = std::shared_ptr; using HttpCallback = std::function)>; } // namespace dp