477bcd00f0
- CMakeLists.txt - agent_protocol.cpp - agent_protocol.h - app.md - appicon.ico - hosts_db.cpp - hosts_db.h - http_client.cpp - http_client.h - main.cpp - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
37 lines
787 B
C++
37 lines
787 B
C++
#pragma once
|
|
#include <string>
|
|
#include <vector>
|
|
#include <utility>
|
|
|
|
namespace pex_http {
|
|
|
|
struct Request {
|
|
std::string method;
|
|
std::string url;
|
|
std::vector<std::pair<std::string,std::string>> headers;
|
|
std::string body;
|
|
std::string bearer_token;
|
|
int timeout_ms = 5000;
|
|
};
|
|
|
|
struct Response {
|
|
int status = 0;
|
|
std::string body;
|
|
std::string error;
|
|
int64_t duration_ms = 0;
|
|
};
|
|
|
|
// Stub local — sera reemplazado por fn_http::request (issue 0110).
|
|
Response request(const Request& req);
|
|
|
|
inline Response get(const std::string& url, const std::string& bearer = "", int timeout_ms = 5000) {
|
|
Request r;
|
|
r.method = "GET";
|
|
r.url = url;
|
|
r.bearer_token = bearer;
|
|
r.timeout_ms = timeout_ms;
|
|
return request(r);
|
|
}
|
|
|
|
} // namespace pex_http
|