HTTP header parsing library

M

mateuszb

Is there any opensource implementation of such library which can be
used to
parse HTTP headers received from server, or can be used to construct
such HTTP
headers ??
 
M

Mateusz Berezecki

Oh right. A marvellous answer. Did you try that query yourself?
I suggest you to do so. Did I write it has to be written in C and not
in python?
Also I am not interested with bugzilla entries for squid proxy...


any other suggestions?
 
M

Mateusz Berezecki

comp.lang.C !

and that google query by Jack Klein shows a lot of results but...
in perl and python.That annoyed me a bit because I did google for 2
days
before asking here. That kind of responses make me angry.

let me be more specific this time. I am looking for an opensource
library
to parse HTTP header responses or something similar to GNet library
so I could write my own HTTP Header parser. Does anybody know if there
is any such library? Is there any decent library similar to GNet? (Gnet
seems
to be _broken_ )

with regards
/mb
 
C

CBFalconer

Mateusz said:
Oh right. A marvellous answer. Did you try that query yourself?
I suggest you to do so. Did I write it has to be written in C and not
in python?
Also I am not interested with bugzilla entries for squid proxy...

any other suggestions?

I have no idea what you are squealing about, since you didn't
bother to include any context (see sig below if due to ignorance).
The only clue remaining is the subject, which is far off topic on
c.l.c, and you should have received no answer whatsoever except for
a possible suggestion of a suitable newsgroup.
 
K

Keith Thompson

Mateusz Berezecki said:
comp.lang.C !

and that google query by Jack Klein shows a lot of results but...
in perl and python.That annoyed me a bit because I did google for 2
days
before asking here. That kind of responses make me angry.

Then I suggest you chill out. If someone attempts to answer my
question, and the answer turns out not to be useful, my usual response
is something like "Thanks for trying, but that's not quite what I was
looking for". If you're going to get angry at people who try to help
you, you're not likely to get much help here.
 
M

Mateusz Berezecki

I have no idea what you are squealing about, since you didn't
bother to include any context (see sig below if due to ignorance).
The only clue remaining is the subject, which is far off topic on
c.l.c, and you should have received no answer whatsoever except for
a possible suggestion of a suitable newsgroup.

ok, I apologise. I didn't want to behave that way. Sorry for problems.

--mb
 
W

websnarf

Is there any opensource implementation of such library which can be
used to parse HTTP headers received from server, or can be used to
construct such HTTP headers ??

HTTP itself is kind of trivial. You should be able to just read the
spec, use something like PRCE, and code up something yourself, if you
are a reasonable programmer.

Otherwise, I think programs like WGET are open source, so you'll be
able to get the idea for it there. If that's not good enough for you,
you can look at the http.c and http.h files for ytoics-c here:

http://cvs.sourceforge.net/viewcvs.py/ytoics/ytoics-c/
 
M

Mateusz Berezecki

HTTP itself is kind of trivial. You should be able to just read the
spec, use something like PRCE, and code up something yourself, if you
are a reasonable programmer.

I actually ended up doing this myself. I did it with a little help
of glib and it seems to work great.Anyways thank you for the answer.



--mb
 
C

CBFalconer

Mateusz said:
ok, I apologise. I didn't want to behave that way. Sorry for problems.

Fair enough. Looks like you can learn. Check the references below.

--
Some useful references about C:
<http://www.ungerhu.com/jxh/clc.welcome.txt>
<http://www.eskimo.com/~scs/C-faq/top.html>
<http://benpfaff.org/writings/clc/off-topic.html>
<http://anubis.dkuug.dk/jtc1/sc22/wg14/www/docs/n869/> (C99)
<http://www.dinkumware.com/refxc.html> (C-library}
<http://gcc.gnu.org/onlinedocs/> (GNU docs)
 
K

Keith Thompson

HTTP itself is kind of trivial. You should be able to just read the
spec, use something like PRCE, and code up something yourself, if you
are a reasonable programmer.

I think you mean PCRE (Perl Compatible Regular Expressions).
Otherwise, I think programs like WGET are open source, so you'll be
able to get the idea for it there. If that's not good enough for you,
you can look at the http.c and http.h files for ytoics-c here:

http://cvs.sourceforge.net/viewcvs.py/ytoics/ytoics-c/

The "curl" program might also be useful.
 
M

Mateusz Berezecki

Keith said:
The "curl" program might also be useful.

Oh, libcurl is just _GREAT_ ;-) have some interesting functions
for character escaping ant groking urls. thanks!

--mb
 
C

Chris Croughton

Oh, libcurl is just _GREAT_ ;-) have some interesting functions
for character escaping ant groking urls. thanks!

Yes, I just looked it (having already reinvented that wheel), it looks
very good. And it's free software (modified MIT licence so it doesn't
have the contaminating 'copyleft' clause).

Thanks, Keith...

Chris C
 
Joined
Apr 13, 2010
Messages
1
Reaction score
0
Mateusz Berezecki said:
Keith Thompson wrote:

> The "curl" program might also be useful.


Oh, libcurl is just _GREAT_ ;-) have some interesting functions
for character escaping ant groking urls. thanks!

--mb
I think the only function in libcurl that involve http header parsing is time_t curl_getdate(const char *p, const time_t *unused);
It would be great if they provide full support for http header parsing though,
I think it would be a great feature.:smoking:

ps: I'm currently using libcurl for client lib and mongoose for server lib.
had to find another lib to do http parsing on my own.
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top