mastodonpp  0.0.0
Public Member Functions | List of all members
mastodonpp::Request Class Reference

Used to make a request to the Mastodon API. More...

#include <mastodonpp/request.hpp>

Inheritance diagram for mastodonpp::Request:
mastodonpp::CURLWrapper

Public Member Functions

 Request (Instance &instance)
 Construct a new Request object. More...
 
answer_type get (API::endpoint_type endpoint) const
 Make a HTTP GET call. More...
 
answer_type get (string endpoint) const
 Make a HTTP GET call. More...
 
- Public Member Functions inherited from mastodonpp::CURLWrapper
 CURLWrapper ()
 Initializes curl and sets up connection. More...
 
 CURLWrapper (const CURLWrapper &other)=default
 Copy constructor. More...
 
 CURLWrapper (CURLWrapper &&other) noexcept=default
 Move constructor. More...
 
virtual ~CURLWrapper () noexcept
 Cleans up curl and connection. More...
 
CURLWrapperoperator= (const CURLWrapper &other)=default
 Copy assignment operator. More...
 
CURLWrapperoperator= (CURLWrapper &&other) noexcept=default
 Move assignment operator. More...
 

Detailed Description

Used to make a request to the Mastodon API.

Since
0.1.0

Constructor & Destructor Documentation

◆ Request()

mastodonpp::Request::Request ( Instance instance)
explicit

Construct a new Request object.

Parameters
instanceAn Instance with the access data.
Since
0.1.0
23  : _instance{instance}
24 {}

Member Function Documentation

◆ get() [1/2]

answer_type mastodonpp::Request::get ( API::endpoint_type  endpoint) const

Make a HTTP GET call.

Parameters
endpointEndpoint as API::endpoint_type, for example: mastodonpp::API::v1::instance.
Since
0.1.0
27 {
28  answer_type answer;
29  answer.body = API{endpoint}.to_string();
30  return answer;
31 }

◆ get() [2/2]

answer_type mastodonpp::Request::get ( string  endpoint) const

Make a HTTP GET call.

Parameters
endpointEndpoint as string, for example: "/api/v1/instance".
Since
0.1.0
34 {
35  answer_type answer;
36  answer.body = endpoint;
37  return answer;
38 }

The documentation for this class was generated from the following files: