mastodonpp  0.0.0
request.hpp
1 /* This file is part of mastodonpp.
2  * Copyright © 2020 tastytea <tastytea@tastytea.de>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License as published by
6  * the Free Software Foundation, version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Affero General Public License for more details.
12  *
13  * You should have received a copy of the GNU Affero General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef MASTODONPP_REQUEST_HPP
18 #define MASTODONPP_REQUEST_HPP
19 
20 #include "api.hpp"
21 #include "instance.hpp"
22 #include "return_types.hpp"
23 
24 #include <string>
25 
26 namespace mastodonpp
27 {
28 
29 using std::string;
30 
36 class Request
37 {
38 public:
46  explicit Request(Instance &instance);
47 
53  answer_type get(API::endpoint_type endpoint) const;
54 
55 private:
56  Instance &_instance;
57 };
58 
59 } // namespace mastodonpp
60 
61 #endif // MASTODONPP_REQUEST_HPP
mastodonpp
C++ wrapper for the Mastodon API.
Definition: api.cpp:23
mastodonpp::Request
Used to make a request to the Mastodon API.
Definition: request.hpp:36
mastodonpp::Request::Request
Request(Instance &instance)
Construct a new Request object.
Definition: request.cpp:22
mastodonpp::Request::get
answer_type get(API::endpoint_type endpoint) const
Make a HTTP GET call.
Definition: request.cpp:26
mastodonpp::answer_type
Return type for Requests.
Definition: return_types.hpp:42
mastodonpp::Instance
Holds the hostname and access token of an instance.
Definition: instance.hpp:34
mastodonpp::API::endpoint_type
variant< v1, v2 > endpoint_type
Type for endpoints. Either API::v1 or API::v2.
Definition: api.hpp:67