curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: a URL API ?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 3 Aug 2018 23:18:13 +0200 (CEST)

On Fri, 3 Aug 2018, Samuel Hurst wrote:

>>   curl_url_set(url_handle, CURLUPART_RELURL, "../image.png", 0);
>
> These may actually be fully qualified URLs, so as long as CURLUPART_RELURL
> doesn't explode when that happens, I don't see any problems with your
> solution. Not having to parse that at the application level would certainly
> make code cleaner (at least at the application side...) and reduce a lot of
> duplication.

It struck me that we can just allow it to work with:

   rc = curl_url_set(urlp, CURLUPART_URL, "../image.png", 0);

so when a new full URL is set, it can be either a new absolute URL *or* a
relative one (if there was a full URL set previously).

I also made up my mind and cut out the "alternative A" version of the API from
the wiki page and now there's only one API there again. The one I called
"alternative B" the other day.

-- 
  / daniel.haxx.se

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