ForestHub SDK 0.1.0
C++14 LLM SDK for PC and embedded platforms
Loading...
Searching...
No Matches
http_client.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-only
2// Copyright (c) 2026 ForestHub. All rights reserved.
3// For commercial licensing, visit https://github.com/ForestHubAI/fh-sdk
4
5#ifndef FORESTHUB_CORE_HTTP_CLIENT_HPP
6#define FORESTHUB_CORE_HTTP_CLIENT_HPP
7
10
11#include <map>
12#include <string>
13
14namespace foresthub {
15namespace core {
16
19 int status_code = 0;
20 std::string body;
21 std::map<std::string, std::string> headers;
22};
23
26public:
27 virtual ~HttpClient() = default;
28
29 using Headers = std::map<std::string, std::string>;
30
35 virtual HttpResponse Get(const std::string& url, const Headers& headers) = 0;
36
42 virtual HttpResponse Post(const std::string& url, const Headers& headers, const std::string& body) = 0;
43
46 virtual void Delay(unsigned long ms) = 0;
47};
48
49} // namespace core
50} // namespace foresthub
51
52#endif // FORESTHUB_CORE_HTTP_CLIENT_HPP
Abstract interface for HTTP operations.
Definition http_client.hpp:25
virtual HttpResponse Post(const std::string &url, const Headers &headers, const std::string &body)=0
Perform a POST request with a raw body.
virtual void Delay(unsigned long ms)=0
Delay execution for retry logic.
virtual HttpResponse Get(const std::string &url, const Headers &headers)=0
Perform a GET request.
Core abstractions: requests, responses, tools, input types, and provider interface.
Top-level namespace for the ForestHub SDK.
Simple HTTP response container.
Definition http_client.hpp:18
std::map< std::string, std::string > headers
Response headers.
Definition http_client.hpp:21
int status_code
HTTP status code (e.g., 200, 404, 500).
Definition http_client.hpp:19
std::string body
Response body (usually JSON).
Definition http_client.hpp:20