diff options
-rw-r--r-- | include/request.hpp | 13 | ||||
-rw-r--r-- | src/request.cpp | 7 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/request.hpp b/include/request.hpp index f1bc6ec..198e5a8 100644 --- a/include/request.hpp +++ b/include/request.hpp @@ -17,11 +17,17 @@ #ifndef MASTODONPP_REQUEST_HPP #define MASTODONPP_REQUEST_HPP +#include "api.hpp" #include "instance.hpp" +#include "return_types.hpp" + +#include <string> namespace mastodonpp { +using std::string; + /*! * @brief Used to make a request to the Mastodon API. * @@ -39,6 +45,13 @@ public: */ explicit Request(Instance &instance); + /*! + * @brief Make a HTTP GET call. + * + * @since 0.1.0 + */ + answer_type get(API::endpoint_type endpoint) const; + private: Instance &_instance; }; diff --git a/src/request.cpp b/src/request.cpp index 26056fc..e2ad4be 100644 --- a/src/request.cpp +++ b/src/request.cpp @@ -23,4 +23,11 @@ Request::Request(Instance &instance) : _instance{instance} {} +answer_type Request::get(API::endpoint_type endpoint) const +{ + answer_type answer; + answer.body = API{endpoint}.to_string(); + return answer; +} + } // namespace mastodonpp |