TankerHQ / fetchpp

A C++17 HTTP asynchronous client

Home Page:https://tanker.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tanker logo

License Last Commit

A C++17 asynchronous HTTP client

Overview · Contributing · License

Overview

Fetchpp is a C++17 asynchronous HTTP client written on top of Boost Beast and ASIO.

It closely follows ASIO API recommendations and style. This allows Fetchpp API to be used with callbacks, std::future, coroutines and more.

Quickstart

#include <fetchpp/get.hpp>

#include <iostream>

int main()
{
  boost::asio::io_context ioc;

  fetchpp::async_get(ioc.get_executor(),
                     "http://httpbin.org/get",
                     [](auto err, auto response) {
                       if (err)
                         std::cerr << err.message() << std::endl;
                       std::cout << response.result_int() << std::endl;
                     });
  ioc.run();
  return 0;
}

Contributing

We welcome feedback. Feel free to open any issue on the Github bug tracker.

License

Fetchpp is licensed under the Apache License, version 2.0.

About

A C++17 HTTP asynchronous client

https://tanker.io

License:Apache License 2.0


Languages

Language:C++ 93.8%Language:CMake 3.8%Language:Python 2.3%Language:Shell 0.1%