• Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    C++
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple & modern HTTP client for C++

http

Simple HTTP asynchronous library for modern C++. Depends on coro. Here's the basic usage:

auto coro = coro::start([]{
    try {
        auto res = http::post(
            "https://192.168.1.154/user/login", 
             "{ \"UserId\": \"matt\", \"Password\": \"matt\"} "
        );

        auto sessionId = res.cookie("SessionId");
        std::cout << sessionId.value() << std::endl;
        std::cout << sessionId.httpOnly() << std::endl;
        std::cout << sessionId.secure() << std::endl;
        std::cout << sessionId.path() << std::endl;
    } catch (coro::SystemError const& ex) {
        std::cerr << ex.what() << std::endl;
    }
});
coro::run();