curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: a URL API ?

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Sun, 12 Aug 2018 18:51:18 +0200 (CEST)

On Sun, 12 Aug 2018, Ray Satiro via curl-library wrote:

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

I don't think exposing such a struct in the API and expecting users to handle
it correctly is a good idea, as I think it's a bit too error-prone.

That API wouldn't support URL encoding/decoding of the parts - which I
believe users will want.

It would also miss some of the features libcurl itself uses (like path-as-is
disallow user) - which would make harder for us to switch to this API
internally.

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