Skip to Content
C++ Reactive Programming
book

C++ Reactive Programming

by Praseed Pai, Peter Abraham
June 2018
Intermediate to advanced
348 pages
8h 45m
English
Packt Publishing
Content preview from C++ Reactive Programming

HTTP client programming using the C++ REST SDK

The C++ REST SDK programming model is inherently  asynchronous in nature, and we can invoke the API calls in a synchronous manner as well. The following program will demonstrate how we can invoke HTTP client API calls asynchronously. The program demonstrates workings of the client side of the HTTP protocol supported by the C++ REST SDK. We use a technique called task continuation (a technique of chaining blocks of code) here to retrieve data from a web page and store it in a local disk file. The C++ REST SDK follows an asynchronous I/O model and we chain operations together. Finally, we invoke the composition using the wait() method:

#include <cpprest/http_client.h> #include <cpprest/filestream.h> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Functional Programming in C++

Functional Programming in C++

Ivan Cukic

Publisher Resources

ISBN: 9781788629775Supplemental Content