diff options
Diffstat (limited to 'src/connection.cpp')
-rw-r--r-- | src/connection.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/connection.cpp b/src/connection.cpp index b7fe886..e6bca95 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -21,20 +21,19 @@ namespace mastodonpp Connection::Connection(Instance &instance) : _instance{instance} + , _baseuri{instance.get_baseuri()} {} -answer_type Connection::get(API::endpoint_type endpoint) +answer_type Connection::get(const API::endpoint_type &endpoint) { - answer_type answer; - answer.body = API{endpoint}.to_string(); - return answer; + return make_request( + http_method::GET, + string(_baseuri).append(API{endpoint}.to_string_view())); } -answer_type Connection::get(string endpoint) +answer_type Connection::get(const string_view &endpoint) { - answer_type answer; - answer.body = make_request(http_method::GET, "https://ip.tastytea.de/"); - return answer; + return make_request(http_method::GET, string(_baseuri).append(endpoint)); } } // namespace mastodonpp |