An Asio HTTP client in 15 minutes

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s