00001
00002 #include "ug_http_client.h"
00003
00004 int main(int argc, char* argv[])
00005 {
00006 try
00007 {
00008 if (argc != 2)
00009 {
00010 std::cout << "Usage: async_client <url>\n";
00011 std::cout << "Example:\n";
00012 std::cout << " async_client www.boost.org/LICENSE_1_0.txt\n";
00013 return 1;
00014 }
00015
00016 boost::asio::io_service io_service;
00017 Moses::http_client c(io_service, argv[1]);
00018 io_service.run();
00019 std::cout << c.content() << std::endl;
00020 }
00021 catch (std::exception& e)
00022 {
00023 std::cout << "Exception: " << e.what() << "\n";
00024 }
00025
00026 return 0;
00027 }