curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: a URL API ?

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Sun, 12 Aug 2018 02:03:06 -0400

On 8/1/2018 6:17 PM, Daniel Stenberg wrote:
> In the 2018 user survey, more than 40% of the 395 users who answered
> the question said they'd use a "URL handling" API in libcurl if one
> existed.
>
> I gave it some thoughts the other day and I've now jotted down my
> initial suggestion on how it could be made to work. An API that can
> parse a URL, extract the individual pieces, allow the user to set
> individual parts and finally to get the full URL out from there again.
>
> Here's my thoughts:
>
>   https://github.com/curl/curl/wiki/URL-API
>
> Good or bad? What would your application need and would this work for
> that? If not, how should we change it to make it better?
>
> (There's no promise that this will ever actually get implemented, but
> if we can come up with a proposal we believe in, I don't think there
> needs to be anything stopping it from happening...)

I think you overdid it (I know, I'm a little behind on this discussion
[1]), a struct would be simpler.

curl_url_parse(url, &parts);

curl_url_build(parts, &url);

Is there really a need for a more expansive API?

[1]: https://www.youtube.com/watch?v=gqQ99s4Ywnw

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2018-08-12