17 #ifndef MASTODONPP_CONNECTION_HPP
18 #define MASTODONPP_CONNECTION_HPP
22 #include "curl_wrapper.hpp"
23 #include "instance.hpp"
26 #include <string_view>
34 using std::string_view;
124 return get(endpoint, {});
149 const string_view _baseuri;
154 #endif // MASTODONPP_CONNECTION_HPP
answer_type get(const endpoint_variant &endpoint, const parametermap ¶meters)
Make a HTTP GET call with parameters.
Definition: connection.cpp:35
string type
The type of the event.
Definition: connection.hpp:62
map< string_view, variant< string_view, vector< string_view > >> parametermap
std::map of parameters for API calls.
Definition: curl_wrapper.hpp:69
Connection(Instance &instance)
Construct a new Connection object.
Definition: connection.cpp:24
answer_type get(const endpoint_variant &endpoint)
Make a HTTP GET call.
Definition: connection.hpp:122
string data
The payload.
Definition: connection.hpp:65
C++ wrapper for the Mastodon API.
Definition: answer.cpp:22
vector< event_type > get_new_events()
Get new stream events.
Definition: connection.cpp:61
variant< API::endpoint_type, string_view > endpoint_variant
An endpoint. Either API::endpoint_type or std::string_view.
Definition: connection.hpp:43
A stream event.
Definition: connection.hpp:52
Return type for Requests.
Definition: answer.hpp:40
Holds the access data of an instance.
Definition: instance.hpp:40
Represents a connection to an instance. Used for requests.
Definition: connection.hpp:75
Handles the details of network connections.
Definition: curl_wrapper.hpp:80
string get_new_stream_contents()
Copy new stream contents and delete the “original”.
Definition: connection.cpp:51