Casablanca's C++ SDK Whitelisted for Open Source
Microsoft's C++ REST SDK, codenamed Casablanca has been open sourced under the Apache license. It is described as a "a Microsoft effort to support cloud-based client-server communication in native code using a modern asynchronous C++ API design." Breaking through the highlevel description, this offering uses C++11 to provide what Microsoft hopes is an easier way to write client-side HTTP code.
Casablanca is multi-platform, supporting Linux as well as Windows 7 and Windows 8. Microsoft developer Artur Laksberg states that support WinXP for and Vista is being developed. Another highlight is its support for asynchronous operations. Microsoft's announcement provides some examples of a file upload via HTTP and creating a JSON object to demonstrate Casablanca in action.
Both the Windows and Linux builds support the following feaures:
- Ability to create a connection to a server via a HTTP Client, send requests and handle response.
- Support for construction and use of Uniform Resource Identifiers (URI).
- Constructing, parsing and serializing JSON values.
- Asynchronously reading/writing bytes to/from an underlying medium via Streams and Stream Buffers.
There are several different Streams and Stream Buffers available: a memory based producer-consumer, files, a memory based stream backed by a STL container, raw pointer streams, and interop streams. This last type of stream allows for "...Casablanca [to provide] two sets of classes, one to give an async stream interface to an iostream, one to give an iostream interface to an async stream."
The Linux http client is somewhat limited in that it does not yet support https, proxies, or authentication, but Microsoft states these features will be part of a future release. CodePlex houses Casablanca's source code where it may be viewed online, obtained via Git, or downloaded as a Zip archive with the latest snapshot.
Srini Penchikala Aug 21, 2014