
Hi Chris, Christopher Kohlhoff skrev:
Hi all,
I have just released a new Boost.Asio-based library, Urdl, which can be used for accessing and downloading web content.
<http://think-async.com/Urdl> <http://sourceforge.net/projects/urdl>
It currently has limited support for the protocols "http", "https" and "file". It provides an easy-to-use extension to standard C++ iostreams and an asynchronous interface for use with Boost.Asio.
Looks really nice. 1. ------ May I suggest that you add a bunch of constants instead of using strings. You currently have // We're doing an HTTP POST ... is.set_option(urdl::http::request_method("POST")); // ... where the MIME type indicates plain text ... is.set_option(urdl::http::request_content_type("text/plain")); I don't like the hard-coding of "POST" and "text/plain". Also for type-safety reasons, strings are usually irritating. Maybe it would be possible to use enumeration values instead: // We're doing an HTTP POST ... is.set_option(urdl::http::request_method::post); // ... where the MIME type indicates plain text ... is.set_option(urdl::http::request_content_type::text_plain)); 2. -------- The Url class has operators like ==, != and <. May I suggets you hass hash_value( const url& ) too. 3. ------ I'm not a fan of short names. Especially http::errc::errc_t would be clearer IMO as http::error_codes::error_code or something like that. -Thorsten