Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this questionI 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.
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...
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
I would suggest you to have a look to cpp-netlib, which is based on Boost.Asio.
精彩评论