watersalesman / BeastQuest

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

Home Page:https://watersalesman.github.io/BeastQuest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BeastQuest

Travis CI Documentation License Coverage Status

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:

  • Timeout specification
  • Streaming requests
  • Cookie support
  • Proxy support

But the following features are supported!

  • GET, POST, DELETE, PUT, and PATCH requests
  • SSL/TLS requests (with or without verification)
  • Asynchronous requests
  • Callback interface
  • Custom request headers/body
  • Url encoded parameters
  • Simple POST forms
  • Multipart POST forms
  • File POST upload
  • Basic authentication

Documentation

Documentation is located here and includes in-depth information on building and usage. It will continue to be updated and improved.

Usage

Using the synchronous API. doing 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 sync and async APIs are built on top of a session-layer API) that also aims to be simple and easy-to-use.

Third-Party Libraries

The following libraries are used in this project:

About

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

https://watersalesman.github.io/BeastQuest/

License:MIT License


Languages

Language:C++ 92.6%Language:CMake 7.4%