Pluralsight blog Where devs, IT admins & creative pros go for news, tips, videos and more.
Pluralsight + Digital-Tutors - 3,000 tech & creative courses - starting at $29/month Get it now →
August 13, 2013

REST Comes to C++ in Visual Studio 2013

By

Visual Studio 2012While the REST SDK for C++ has been around for a while on CodePlex, it’s now taking its rightful place as full member of the Visual Studio 2013 installation.  Code named “Casablanca”, the REST SDK for C++ includes support for JSON serialization, asynchronous streams, as well as a PPL Task programming model.  Designed to enable both client REST calls as well as the hosting of non-IIS based services, this SDK also includes a reimplementation of the HTTP Listener library.

The REST SDK for C++ is intended to be platform independent which required some customization of the PPL Tasks library to allow for use on Linux or older versions of .NET.

All the asynchronous APIs in Casablanca build on the PPL tasks library that is shipping in the next version of Visual Studio. In order to make Casablanca usable also with Visual Studio 2010 and on Linux, we have built a special version of PPL tasks and included it in the Casablanca release. In order for it peacefully co-exist with PPL, we placed the special version in a different namespace, “pplx.” — Visual C++ Team Blog

JSON support is also a key feature of the SDK, and this example from Marius Bancila’s Blog shows how to make an asynchronous REST call that returns JSON.

code1

Creating a server listening on a specific URI is also possible using the HTTP Listener library.  For an example of how to implement an HTTP Listener, you can view the Casablanca Code Plex documentation here.

About the Author

is a Chief Architect specializing in large scale distributed system development and enterprise software processes. Paul has more than twenty years of development experience including being a former Microsoft MVP, a speaker at technical conferences such as Microsoft Tech-Ed and VSLive, and a published author. Prior to working on the Windows platform, he built software using a vast array of technologies including Java, Unix, C, and even OS/2.


Discussion