tags:

views:

323

answers:

2

Hi,

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.

+3  A: 

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...

dicroce
Simple, if you don't care about getting all the corner cases right. Multi-line status codes, escape characters, international strings.
Ben Voigt
True enough. Didn't matter for my use...
dicroce
+1  A: 

Check out libebb, it has a parser generated with Raegel 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

clyfe