Namespaces | |
| namespace | CppHttplibBackend |
| namespace | CurlBackend |
| namespace | detail |
| namespace | GitHub |
| namespace | QtBackend |
Classes | |
| class | BaseConnection |
| base class with common parts for backend specific implementations More... | |
| struct | Detached |
| Fire-and-forget coroutine wrapper. More... | |
| struct | HttpError |
| Represents an HTTP or network-level error. More... | |
| struct | IConnection |
| Interface representing connection with rest api server. More... | |
| struct | IPaginationStrategy |
| Interface for pagination strategies. More... | |
| struct | ISseConnection |
| Interface for SSE (Server-Sent Events) connections. More... | |
| class | LinkHeaderPaginationStrategy |
| Pagination strategy using RFC 5988 Link headers. More... | |
| struct | Response |
| HTTP response containing body, raw headers and the HTTP status code. More... | |
| struct | SseEvent |
| Represents a single Server-Sent Event. More... | |
| class | SseParser |
| Incremental parser for Server-Sent Events stream. More... | |
| class | ThreadedConnection |
| BaseConnection subclass that implements fetch(url, cb) via a background std::thread. More... | |
Typedefs | |
| using | CancellationToken = std::shared_ptr<std::atomic<bool>> |
| Token returned by asynchronous fetch(); set it to true to cancel the request. | |
Functions | |
| detail::FetchAwaitable | coFetch (IConnection &connection, const std::string &request) |
| Asynchronously fetch a single resource. | |
| detail::PaginatedFetchAwaitable | coFetch (IConnection &connection, const std::string &request, IPaginationStrategy &strategy) |
| Asynchronously fetch with pagination. | |
| CPP_RESTAPI_EXPORT std::unique_ptr< IConnection > | createCppHttplibConnection (const std::string &address, const std::map< std::string, std::string > &headerEntries) |
| Create a connection using the cpp-httplib backend. | |
| CPP_RESTAPI_EXPORT std::unique_ptr< IConnection > | createCurlConnection (const std::string &address, const std::map< std::string, std::string > &headerEntries) |
| Create a connection using the libcurl backend. | |
| CPP_RESTAPI_EXPORT std::unique_ptr< IConnection > | createQtConnection (QNetworkAccessManager &manager, const std::string &address, const std::map< std::string, std::string > &headerEntries) |
| Create a connection using the Qt backend. | |
| using cpp_restapi::CancellationToken = std::shared_ptr<std::atomic<bool>> |
Token returned by asynchronous fetch(); set it to true to cancel the request.
|
inline |
Asynchronously fetch a single resource.
Returns an awaitable — use with co_await:
|
inline |
Asynchronously fetch with pagination.
Returns an awaitable — use with co_await:
| CPP_RESTAPI_EXPORT std::unique_ptr< IConnection > cpp_restapi::createCppHttplibConnection | ( | const std::string & | address, |
| const std::map< std::string, std::string > & | headerEntries ) |
Create a connection using the cpp-httplib backend.
| address | base URL of the API (e.g. "https://api.github.com") |
| headerEntries | HTTP headers added to every request |
| CPP_RESTAPI_EXPORT std::unique_ptr< IConnection > cpp_restapi::createCurlConnection | ( | const std::string & | address, |
| const std::map< std::string, std::string > & | headerEntries ) |
Create a connection using the libcurl backend.
| address | base URL of the API (e.g. "https://api.github.com") |
| headerEntries | HTTP headers added to every request |
| CPP_RESTAPI_EXPORT std::unique_ptr< IConnection > cpp_restapi::createQtConnection | ( | QNetworkAccessManager & | manager, |
| const std::string & | address, | ||
| const std::map< std::string, std::string > & | headerEntries ) |
Create a connection using the Qt backend.
| manager | Qt network access manager (must outlive the connection) |
| address | base URL of the API (e.g. "https://api.github.com") |
| headerEntries | HTTP headers added to every request |