12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- /**
- * \file
- * The most simple example.
- *
- */
- #include <curlpp/cURLpp.hpp>
- #include <curlpp/Easy.hpp>
- #include <curlpp/Options.hpp>
- using namespace curlpp::options;
- int main(int, char **)
- {
- try
- {
- // That's all that is needed to do cleanup of used resources (RAII style).
- curlpp::Cleanup myCleanup;
- // Our request to be sent.
- curlpp::Easy myRequest;
- // Set the URL.
- myRequest.setOpt<Url>("http://example.com");
- // Send request and get a result.
- // By default the result goes to standard output.
- myRequest.perform();
- }
- catch(curlpp::RuntimeError & e)
- {
- std::cout << e.what() << std::endl;
- }
- catch(curlpp::LogicError & e)
- {
- std::cout << e.what() << std::endl;
- }
-
- return 0;
- }
|