Updated example in documentation.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
398383143a
commit
9a6cfdc899
|
@ -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
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user