Downloading a Web page in C++ using Boost.Asio

#include <iostream>
#include <boost/asio.hpp>

int main()
{
    boost::asio::ip::tcp::iostream stream("www.martinbroadhurst.com", "http");
    stream << "GET / HTTP/1.1\r\n";
    stream << "Host: www.martinbroadhurst.com\r\n";
    stream << "Accept: */*\r\n";
    stream << "Connection: close\r\n\r\n";
    stream.flush();
    std::cout << stream.rdbuf();
}

Reference: Boost.Asio