25#include <unordered_map>
62 std::unordered_map<std::string, std::string>
headers()
const;
67 std::unique_ptr<Impl> impl_;
73 explicit HttpClient(std::unordered_map<std::string, std::string> default_headers = {});
83 const std::unordered_map<std::string, std::string>& params,
84 const std::unordered_map<std::string, std::string>& headers,
89 const std::unordered_map<std::string, std::string>& headers,
95 const std::string& path,
96 const std::unordered_map<std::string, std::string>& form_data,
97 const std::unordered_map<std::string, std::string>& headers,
102 const std::unordered_map<std::string, std::string>& headers,
108 const std::unordered_map<std::string, std::string>& params,
109 const std::unordered_map<std::string, std::string>& headers,
114 std::unordered_map<std::string, std::string> default_headers_;
115 std::unique_ptr<cpr::ConnectionPool> connection_pool_;
Error handler interface for processing REST API error responses. Maps HTTP status codes to appropriat...
Definition error_handlers.h:37
HTTP client for making requests to Iceberg REST Catalog API.
Definition http_client.h:71
Result< HttpResponse > Post(const std::string &path, const std::string &body, const std::unordered_map< std::string, std::string > &headers, const ErrorHandler &error_handler, auth::AuthSession &session)
Sends a POST request.
Result< HttpResponse > PostForm(const std::string &path, const std::unordered_map< std::string, std::string > &form_data, const std::unordered_map< std::string, std::string > &headers, const ErrorHandler &error_handler, auth::AuthSession &session)
Sends a POST request with form data.
Result< HttpResponse > Delete(const std::string &path, const std::unordered_map< std::string, std::string > ¶ms, const std::unordered_map< std::string, std::string > &headers, const ErrorHandler &error_handler, auth::AuthSession &session)
Sends a DELETE request.
Result< HttpResponse > Get(const std::string &path, const std::unordered_map< std::string, std::string > ¶ms, const std::unordered_map< std::string, std::string > &headers, const ErrorHandler &error_handler, auth::AuthSession &session)
Sends a GET request.
Result< HttpResponse > Head(const std::string &path, const std::unordered_map< std::string, std::string > &headers, const ErrorHandler &error_handler, auth::AuthSession &session)
Sends a HEAD request.
A simple wrapper for cpr::Response.
Definition http_client.h:45
std::string body() const
Get the body of the response as a string.
int32_t status_code() const
Get the HTTP status code of the response.
std::unordered_map< std::string, std::string > headers() const
Get the headers of the response as a map.
An authentication session that can authenticate outgoing HTTP requests.
Definition auth_session.h:48
Define symbol visibility macros for the REST catalog library.
REST catalog APIs.
Definition auth_manager.h:34
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.