mastodon-cpp
0.15.1
|
http class. Do not use this directly. More...
#include <mastodon-cpp.hpp>
Public Types | |
enum | method { GET, PATCH, POST, PUT, DELETE, GET_STREAM } |
HTTP methods. | |
Public Member Functions | |
http (const API &api, const string &instance, const string &access_token) | |
const uint_fast16_t | request (const method &meth, const string &path, string &answer) |
const uint_fast16_t | request (const method &meth, const string &path, const curlpp::Forms &formdata, string &answer) |
HTTP Request. More... | |
const void | get_headers (string &headers) const |
Get all headers in a string. | |
const void | cancel_stream () |
Cancels the stream. Use only with streams. More... | |
const void | abort_stream () |
std::mutex & | get_mutex () |
Gets the mutex guarding the string that is written to. More... | |
http class. Do not use this directly.
const void API::http::cancel_stream | ( | ) |
std::mutex & API::http::get_mutex | ( | ) |
Gets the mutex guarding the string that is written to.
The mutex guards the function that writes to the string you specified in get_stream().
const uint_fast16_t API::http::request | ( | const method & | meth, |
const string & | path, | ||
const curlpp::Forms & | formdata, | ||
string & | answer | ||
) |
HTTP Request.
meth | The method defined in http::method |
path | The api call as string |
formdata | The form data for PATCH and POST requests. |
answer | The answer from the server |