cpp Rest API master
C++ library for REST API access with Qt, Curl and cpp-httplib backends
 
Loading...
Searching...
No Matches
curl_connection.hpp
Go to the documentation of this file.
1
2#ifndef CONNECTION_QT_HPP
3#define CONNECTION_QT_HPP
4
6#include "cpp_restapi_export.h"
7
8
10{
11 class [[deprecated("Use createCurlConnection() from <cpp_restapi/create_curl_connection.hpp>")]] CPP_RESTAPI_EXPORT Connection: public ThreadedConnection
12 {
13 public:
14 Connection(const std::string& address, const std::map<std::string, std::string>& headerEntries);
15 Connection(const Connection &) = delete;
16
18
19 Connection& operator=(const Connection &) = delete;
20
21 Response fetchPage(const std::string& request) override;
22 std::unique_ptr<ISseConnection> subscribe(const std::string& request, EventCallback callback) override;
23 };
24}
25
26#endif
Definition curl_connection.hpp:12
std::unique_ptr< ISseConnection > subscribe(const std::string &request, EventCallback callback) override
Subscribe to an SSE endpoint.
Response fetchPage(const std::string &request) override
Connection & operator=(const Connection &)=delete
Connection(const Connection &)=delete
Connection(const std::string &address, const std::map< std::string, std::string > &headerEntries)
BaseConnection subclass that implements fetch(url, cb) via a background std::thread.
Definition threaded_connection.hpp:25
Definition curl_connection.hpp:10
std::function< void(const SseEvent &)> EventCallback
Definition iconnection.hpp:41
HTTP response containing body, raw headers and the HTTP status code.
Definition iconnection.hpp:26