C++ REST SDK (Casablanca)

repository·master·Indexed 27 days ago

https://github.com/microsoft/cpprestsdk

A Microsoft project for cloud-based client-server communication using a modern, asynchronous C++ API. It provides tools for HTTP client/server, WebSockets, oAuth, JSON, URI, and asynchronous streams, utilizing PPL Tasks for concurrency. Supports Windows, Linux, OS X, Unix, iOS, and Android.

Tokens
363
Snippets
1
Records
3
Agent score
44%

What's inside cpprestsdk

  1. Overview of C++ REST SDK features

    master

    The C++ REST SDK provides tools for cloud-based client-server communication using an asynchronous C++ API. Key features include:

    • Communication: HTTP client/server, WebSockets client, and oAuth.
    • Data Handling: JSON, URI, and asynchronous streams.
    • Concurrency: PPL Tasks (Parallel Patterns Library) for composing asynchronous operations based on C++ 11 features.
    • Supported Platforms: Windows desktop, Windows Store (UWP), Linux, OS X, Unix, iOS, and Android.
  2. Install the C++ REST SDK

    master

    The C++ REST SDK can be installed via several package managers depending on your platform:

    • Windows (vcpkg): Use vcpkg install cpprestsdk cpprestsdk:x64-windows.
    • Debian/Ubuntu (apt-get): Use sudo apt-get install libcpprest-dev.
    • Fedora (dnf): Use sudo dnf install cpprest-devel.
    • macOS (Homebrew): Use brew install cpprestsdk.
    • Windows for Android (NuGet): Use Install-Package cpprestsdk.android in the Package Manager console.
  3. Configure CMake to use cpprestsdk

    master

    To use the C++ REST SDK in a CMake project, use find_package(cpprestsdk REQUIRED) and link against the cpprestsdk::cpprest target.

    cmake_minimum_required(VERSION 3.9)
    project(main)
    
    find_package(cpprestsdk REQUIRED)
    
    add_executable(main main.cpp)
    target_link_libraries(main PRIVATE cpprestsdk::cpprest)