NeoGraph 0.10.0
A C++17 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
curl_h2_pool.h
Go to the documentation of this file.
1
25#pragma once
26
27#include <neograph/api.h>
28#include <neograph/async/http_client.h> // HttpResponse + RequestOptions
29
30#include <asio/any_io_executor.hpp>
31#include <asio/awaitable.hpp>
32
33#include <memory>
34#include <string>
35#include <utility>
36#include <vector>
37
38namespace neograph::async {
39
40class NEOGRAPH_API CurlH2Pool {
41public:
42 CurlH2Pool();
43 ~CurlH2Pool();
44
45 CurlH2Pool(const CurlH2Pool&) = delete;
46 CurlH2Pool& operator=(const CurlH2Pool&) = delete;
47
53 asio::awaitable<HttpResponse> async_post(
54 std::string url,
55 std::string body,
56 std::vector<std::pair<std::string, std::string>> headers = {},
57 RequestOptions opts = {});
58
59private:
60 struct Impl;
61 std::unique_ptr<Impl> impl_;
62};
63
64} // namespace neograph::async
NEOGRAPH_API export/import macro for shared-library builds.
Minimal async HTTP/1.1 POST client on asio coroutines.
NEOGRAPH_API asio::awaitable< HttpResponse > async_post(asio::any_io_executor ex, std::string_view host, std::string_view port, std::string_view path, std::string_view body, std::vector< std::pair< std::string, std::string > > headers={}, bool tls=false, RequestOptions opts={})
Async HTTP(S) POST.