mastodon-cpp  0.101.1
Namespaces | Classes | Typedefs | Enumerations
Mastodon Namespace Reference

Collection of things to interface with server software that implements the Mastodon API. More...

Namespaces

 Easy
 Collection of things that make it easier to interface with server software that implements the Mastodon API.
 

Classes

class  API
 Interface to the Mastodon API. More...
 
struct  param
 A single parameter. More...
 
struct  parameters
 Vector of Mastodon::param, used for passing parameters in calls. More...
 
struct  return_base
 Basis for return types. More...
 
struct  return_call
 Return type for API calls. More...
 

Typedefs

typedef struct Mastodon::return_base return_base
 Basis for return types. More...
 
typedef Mastodon::return_call return_call
 Return type for API calls. More...
 
typedef struct Mastodon::param param
 A single parameter. More...
 
typedef Mastodon::parameters parameters
 Vector of Mastodon::param, used for passing parameters in calls. More...
 

Enumerations

enum  http_method {
  GET, PATCH, POST, PUT,
  DELETE, GET_STREAM
}
 HTTP methods. Used in API calls. More...
 

Detailed Description

Collection of things to interface with server software that implements the Mastodon API.

Typedef Documentation

◆ param

A single parameter.

Parameters
keyThe key as a string.
valuesThe values as a vector of strings.
Since
0.100.0

◆ parameters

Vector of Mastodon::param, used for passing parameters in calls.

The only difference to a std::vector<param> is the added member find.

Example:

{
{ "media_ids", { "1234", "4321" } },
{ "status", { "Hello world!" } }
};
Since
0.100.0

◆ return_base

Basis for return types.

Since
0.100.0

◆ return_call

Return type for API calls.

Example:

Mastodon::return_call ret = masto.get(Mastodon::API::v1::instance);
if (!ret) // Or ret.error_code != 0
{
cout << "Error " << std::to_string(ret.error_code);
cout << " (HTTP " << std::to_string(ret.http_error_code) << "): ";
cout << ret.error_message << endl
}
else
{
cout << ret << endl; // Or ret.answer
}
Since
0.100.0

Enumeration Type Documentation

◆ http_method

enum Mastodon::http_method
strong

HTTP methods. Used in API calls.

Since
0.100.0
88  {
89  GET,
90  PATCH,
91  POST,
92  PUT,
93  DELETE,
94  GET_STREAM
95  };