This episode completes our introduction to the Asio C++ networking library by coding up an HTTP client app capable of retrieving content from the web. Rather than create a toy example using a trivial protocol, I wanted to demonstrate how easy it can be to write a practical app in just a short amount of time. Of course don’t interpret this as a license to continue the work and try to roll your own HTTP client library.
Instead consider this a quick guide for implementing legacy or custom wire protocols with a modern networking library. If you are really interested in accessing or serving content via HTTP, consider using the powerful Beast HTTP/WebSocket C++ library. It’s based on Asio and was just accepted to the Boost C++ libraries. Part of my inspiration for recording codecasts and writing this blog came from listening to Vinne Falco (the author of Beast) interviewing on the CppCast podcast.