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
|
||||
*
|
||||
* @code
|
||||
* try
|
||||
* #include <mastodonpp/mastodonpp.hpp>
|
||||
* #include <iostream>
|
||||
*
|
||||
* int main()
|
||||
* {
|
||||
* mastodonpp::Instance instance{"example.com", ""};
|
||||
* mastodonpp::Request request{instance};
|
||||
* auto answer{request.get(mastodonpp::API::v1::instance)};
|
||||
* std::cout << answer << std::endl;
|
||||
* }
|
||||
* catch (const mastodonpp::CURLException &e)
|
||||
* {
|
||||
* std::cerr << e.what() << std::endl;
|
||||
* std::cout << "Maximum characters per post: "
|
||||
* << instance.get_max_chars() << std::endl;
|
||||
*
|
||||
* mastodonpp::Connection connection{instance};
|
||||
*
|
||||
* auto answer{connection.get(mastodonpp::API::v1::instance)};
|
||||
* if (answer)
|
||||
* {
|
||||
* std::cout << answer << std::endl;
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user