curl-library
Re: a URL API ?
Date: Mon, 6 Aug 2018 10:07:36 +0200 (CEST)
On Thu, 2 Aug 2018, Daniel Stenberg wrote:
> Good or bad? What would your application need and would this work for that?
I've written some initial code for this API [1] now. As I proceed further, I
intend to remove the wiki page as I suspect there will be a lot of details
that have changed and I'll instead get the details right and documented in the
coming man pages for the new stuff.
curl_url() mostly works and there's a bunch of tests for the fundamentals.
curl_url_get() works to extract all the parsed parts except CURLUPART_URL.
curl_url_cleanup() works.
The initial work exists in a separate branch [2] - and as long as I'm the only
developer in this branch I intend to rebase and squash it regularly. Just
beware.
The current api header can also be browsed online at [3].
Next up, I intend to:
- implement the missing pieces of the API:
curl_url_get's CURLUPART_URL option
curl_url_set()
curl_url_dup()
- add more test cases to make sure the functions work, also to make it easy to
add more tests later
- write documentation for the new functions and options
- make use of the new parser for the existing libcurl functionlity to reduce
code duplication and make sure the URL API and the libcurl transfer engine
treat URLs identically
- add a curl_easy_setopt() option to take a CURLURL pointer instead of a URL
string
- consider command line tool access to the URL API for parsing URLs
There's not yet any schedule for when this can land. I intend to mark this API
as "experimental" for the first few releases it appears to signal to users and
us all what to expect from it. Maybe this is 7.63.0 material?
[1] = https://github.com/curl/curl/wiki/URL-API
[2] = https://github.com/curl/curl/tree/URL-API
[3] = https://github.com/curl/curl/blob/URL-API/include/curl/urlapi.h
-- / daniel.haxx.se ------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2018-08-06