Recommendation for a HTTP parsing library in C/C++

36,639

Solution 1

Check out libebb, it has a parser generated with Ragel using the easy yet powerful PEG (it's based on Zed Shaw's mongrel parser)

libebb is a lightweight HTTP server library for C. It lays the foundation for writing a web server by providing the socket juggling and request parsing. By implementing the HTTP/1.1 grammar provided in RFC2612, libebb understands most most valid HTTP/1.1 connections (persistent, pipelined, and chunked requests included) and rejects invalid or malicious requests. libebb supports SSL over HTTP.

Also check this speedy parser

Solution 2

About 6 months ago, I was looking for the same exact thing. Then I found this page: HTTP Made Really Really Easy and I just wrote my own... Works great, surprisingly simple to implement...

Solution 3

I would suggest you to have a look to cpp-netlib, which is based on Boost.Asio.

Share:
36,639
michael
Author by

michael

Updated on July 20, 2022

Comments

  • michael
    michael almost 2 years

    I am looking for HTTP parsing library for C/C++. I have looked curl library, but it seems it is a http client library. I am looking for a library which parses HTTP header (e.g. a way to get the query string, get cookie, get request url, get Post Data)?

    Thank you.