mastodonpp
0.5.7
C++ wrapper for the Mastodon and Pleroma APIs.
|
Return type for Requests. More...
#include <types.hpp>
Public Member Functions | |
operator bool () const | |
Returns true if curl_error_code is 0 and http_status is 200, false otherwise. More... | |
operator string_view () const | |
Returns body as std::string_view . More... | |
string_view | get_header (string_view field) const |
Returns the value of a header field. More... | |
parametermap | next () const |
Returns the parameters needed for the next entries. More... | |
parametermap | prev () const |
Returns the parameters needed for the previous entries. More... | |
Public Attributes | |
uint8_t | curl_error_code {0} |
The error code returned by libcurl. More... | |
string | error_message |
The error message. More... | |
uint16_t | http_status {0} |
HTTP status code. More... | |
string | headers |
The headers of the response from the server. More... | |
string | body |
The response from the server, usually JSON. More... | |
Friends | |
ostream & | operator<< (ostream &out, const answer_type &answer) |
Returns body as std::ostream . More... | |
Return type for Requests.
string_view mastodonpp::answer_type::get_header | ( | string_view | field | ) | const |
Returns the value of a header field.
Is only valid for as long as the answer_type is in scope.
field | Case insensitive, only ASCII. |
|
inline |
|
explicit |
Returns true if curl_error_code is 0 and http_status is 200, false otherwise.
|
explicit |
Returns body as std::string_view
.
|
inline |
|
friend |
string mastodonpp::answer_type::body |
The response from the server, usually JSON.
uint8_t mastodonpp::answer_type::curl_error_code {0} |
string mastodonpp::answer_type::error_message |
The error message.
string mastodonpp::answer_type::headers |
The headers of the response from the server.
uint16_t mastodonpp::answer_type::http_status {0} |
HTTP status code.