View GitHub Repo

BeastQuest

An easy-to-use HTTP request library for C++ using the Boost Beast library

Introduction

BeastQuest is an easy-to-use HTTP request library for C++ made by humans for humans. This library is heavily inspired by C++ Requests and Python Requests. This was largely created as a proof-of-concept project utilizing the Boost Beast library that was introduced in Boost 1.66.

Features

Because Boost Beast only provides a protocol-level interface for HTTP, many features have to be implemented from scratch. The following features are not available at the moment:

But the following features are supported!

Usage

BeastQuest aims to give a simple, no nonsense approach to sending HTTP requests. For example, using the synchronous API. sending a GET request is as simple as:

#include <beastquest/beastquest.hh>
#include <iostream>

int main() {
    quest::Url url("https://httpbin.org/get");
    auto response = quest::Get(url);

    if (response.status_code == 200)
        std::cout << response.content << std::endl;

    return 0;
}

The synchronous and asynchronous APIs are built on top of a session-layer API that also aims to be simple and easy-to-use. More information for each can be found in the documentation.

Third-Party Libraries

The following libraries are used in this project: