18#include <asio/awaitable.hpp>
19#include <asio/any_io_executor.hpp>
28namespace neograph::async {
30struct NEOGRAPH_API HttpResponse {
38 std::string retry_after;
56 std::vector<std::pair<std::string, std::string>> headers;
61 std::string_view get_header(std::string_view name)
const noexcept;
100 asio::any_io_executor ex,
101 std::string_view host,
102 std::string_view port,
103 std::string_view path,
104 std::string_view body,
105 std::vector<std::pair<std::string, std::string>> headers = {},
107 RequestOptions opts = {});
114 asio::any_io_executor ex,
115 std::string_view host,
116 std::string_view port,
117 std::string_view path,
118 std::vector<std::pair<std::string, std::string>> headers = {},
120 RequestOptions opts = {});
148 asio::any_io_executor ex,
149 std::string_view host,
150 std::string_view port,
151 std::string_view path,
152 std::string_view body,
153 std::vector<std::pair<std::string, std::string>> headers,
155 std::function<
void(std::string_view chunk)> on_chunk,
NEOGRAPH_API export/import macro for shared-library builds.
NEOGRAPH_API asio::awaitable< HttpStreamResponse > async_post_stream(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, std::function< void(std::string_view chunk)> on_chunk, RequestOptions opts={})
Async HTTP(S) POST where the server emits a Transfer-Encoding: chunked response body.
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.
NEOGRAPH_API asio::awaitable< HttpResponse > async_get(asio::any_io_executor ex, std::string_view host, std::string_view port, std::string_view path, std::vector< std::pair< std::string, std::string > > headers={}, bool tls=false, RequestOptions opts={})
Async HTTP(S) GET.
Metadata returned by async_post_stream after the body has been fully delivered via the callback.
std::chrono::milliseconds timeout
Per-hop deadline covering connect + handshake + write + read of one HTTP exchange.
int max_redirects
Max 3xx hops to follow automatically.