Robin
Robin

Reputation:

How to parse a URL in C?

Im wondering how to parse a url into an URL object(of some kind) in C. So that I would be able to extract key/val objects from a querystring.

Have looked at: Best ways of parsing a URL using C?

And several other resources, even Google Code, but haven't found anything in my taste.. And no, using sscanf, and regex is not an alternative. Saying, unless I have to write my own parser..

Would be greatful for any tips or help on where I could find this!

Upvotes: 1

Views: 7482

Answers (3)

user301649
user301649

Reputation:

I extracted a the parser from wget:

http://eduardo38.netne.net/url_parse.tar.gz

Upvotes: 0

ardsrk
ardsrk

Reputation: 2447

Looking at wget would be worth it. Download the source and look at url_parse function in src/url.c.

Hope this helps.

Upvotes: 1

Pavel Minaev
Pavel Minaev

Reputation: 101655

UriParser

Upvotes: 3

Related Questions