A C++, header-only, standard compliant HTTP request parser 👻
A header-only, RFC compliant, HTTP parser in C++
Hyperspirit is built with Boost.Spirit (“hypertext transfer protocol” + “boost spirit” = hyperspirit), a library for
creating parser grammars.
Features:
There is no build step required as the library is header-only, but the following steps can be followed to build the unit
test suite.
brew install cmake boost
# apt-get install cmake libboost
# yum install cmake libboost
$ git clone git@github.com:cjgdev/hyperspirit.git
$ mkdir build && cd build
$ cmake ../ && make test
#include <hyperspirit/hyperspirit.hpp>
namespace hyperspirit::http = http;
// ...
// parse the `input` string
http::request req;
http::request_parser<string::const_iterator> grammar;
if (parse(input.begin(), input.end(), grammar, data)) {
// the parsed data is in `req`
}
Please refer to the wiki for the latest documentation.
The library is licensed under the BSD license. A copy can be found here.