Skip to content

About

A Lightweight C++ HTTP Library for Creating and Handling HTTP Requests and Responses

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

252 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP Library

A lightweight C++ HTTP library for creating and handling HTTP requests and responses.

Note

The library only works on POSIX-compliant systems.


Features

  • Create and handle HTTP requests and responses (can be used as both an HTTP server and an HTTP client)
  • Uses bokshi-gh/http-codec library to encode and decode HTTP requests and responses
  • Includes nlohmann/json for parsing and serializing JSON data
  • Includes bokshi-gh/dotenv-cpp utility for loading environment variables directly from a file

Installation

  • Install via the installer script:

    curl -fsSL https://raw.githubusercontent.com/bokshi-gh/http-library/main/scripts/install.sh | sudo bash

Requirements: cURL, GNU Make, and GCC

You can check the source code of the installer script here.


Integrate Into Your Project

  • Example code demonstrating how to use the library is available in examples/http_library_server_demo.cpp and examples/http_library_client_demo.cpp

  • Include the header in your C++ project:

    #include <bokshi/http_library.hpp>
  • Link the library when compiling your project:

    • If you need server, compile like:

      g++ main.cpp -lhttp_library -pthread -o my_server
    • If you only need client, compile like:

      g++ main.cpp -lhttp_library -o my_client

Uninstallation

  • Remove the installed headers and library files from the system:

    sudo rm -f /usr/local/include/bokshi/
    sudo rm -f /usr/local/lib/libhttp_library.a
    sudo ldconfig

License

This project is licensed under the GPL-3.0 license.

About

A Lightweight C++ HTTP Library for Creating and Handling HTTP Requests and Responses

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages