17 #ifndef MASTODONPP_ANSWER_HPP
18 #define MASTODONPP_ANSWER_HPP
23 #include <string_view>
32 using std::string_view;
88 explicit operator bool()
const;
95 explicit operator string_view()
const;
113 string_view
get_header(string_view field)
const;
118 #endif // MASTODONPP_ANSWER_HPP
friend ostream & operator<<(ostream &out, const answer_type &answer)
Returns body as std::ostream.
Definition: answer.cpp:38
string headers
The headers of the response from the server.
Definition: answer.hpp:73
uint8_t curl_error_code
The error code returned by libcurl.
Definition: answer.hpp:52
C++ wrapper for the Mastodon API.
Definition: answer.cpp:22
string body
The response from the server, usually JSON.
Definition: answer.hpp:80
string error_message
The error message.
Definition: answer.hpp:59
Return type for Requests.
Definition: answer.hpp:42
string_view get_header(string_view field) const
Returns the value of a header field.
Definition: answer.cpp:44
uint16_t http_status
HTTP status code.
Definition: answer.hpp:66