45 int timeout_seconds = 30);
49 std::string_view body,
50 std::string_view content_type =
"application/json",
51 int timeout_seconds = 30);
55 int timeout_seconds = 60);
Definition generated_event_source.hpp:33
bool http_download(std::string_view url, std::string_view output_path, int timeout_seconds=60)
Download a file from a URL to a local path. Returns true on success.
HttpResponse http_post(std::string_view url, std::string_view body, std::string_view content_type="application/json", int timeout_seconds=30)
Perform an HTTP POST request with a body.
std::function< bool(std::string_view)> HttpChunkCallback
Definition http.hpp:13
HttpResponse http_request(const HttpRequest &request)
Perform an HTTP request. GET and POST are supported.
std::map< std::string, std::string > HttpHeaders
Definition http.hpp:12
HttpResponse http_get(std::string_view url, int timeout_seconds=30)
Perform an HTTP GET request.
HttpChunkCallback on_chunk
Definition http.hpp:26
int timeout_seconds
Definition http.hpp:21
std::string url
Definition http.hpp:16
std::string content_type
Definition http.hpp:19
HttpHeaders headers
Definition http.hpp:20
std::string body
Definition http.hpp:18
std::string method
Definition http.hpp:17
HttpHeaders headers
Definition http.hpp:32
std::string body
Definition http.hpp:31
bool ok() const
Definition http.hpp:35
int status_code
Definition http.hpp:30
std::string error
Definition http.hpp:33