Updated example in documentation.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
tastytea 2020-01-05 13:40:21 +01:00
parent 398383143a
commit 9a6cfdc899
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07

View File

@ -48,16 +48,22 @@
* @subsection Example * @subsection Example
* *
* @code * @code
* try * #include <mastodonpp/mastodonpp.hpp>
* #include <iostream>
*
* int main()
* { * {
* mastodonpp::Instance instance{"example.com", ""}; * mastodonpp::Instance instance{"example.com", ""};
* mastodonpp::Request request{instance}; * std::cout << "Maximum characters per post: "
* auto answer{request.get(mastodonpp::API::v1::instance)}; * << instance.get_max_chars() << std::endl;
* std::cout << answer << std::endl; *
* } * mastodonpp::Connection connection{instance};
* catch (const mastodonpp::CURLException &e) *
* { * auto answer{connection.get(mastodonpp::API::v1::instance)};
* std::cerr << e.what() << std::endl; * if (answer)
* {
* std::cout << answer << std::endl;
* }
* } * }
* @endcode * @endcode
* *