curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Outputting URL components

From: Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>
Date: Wed, 29 Mar 2023 10:49:59 +0200 (CEST)

Hello friends.

I'm working on this little PR that I figure could use some more visibility and
brain storming: https://github.com/curl/curl/pull/10853

It adds ten new variables to the -w/--write-out option to allow different
parts of the used URL to get output separately. Basically helping to split up
the URL. Something that is very tricky to do in for example an ordinary shell
script.

The new variables are currently called "url-[part]" and this is the complete
list:

   url-scheme, url-user, url-password, url-options, url-host, url-port,
   url-path, url-query, url-fragment, url-zoneid

- Should we rather use a dot (.) instead of minus (-) like "url.scheme"
   instead?

- Is this generally a feature you would like?

- This feature is so far made for the *input* URL that curl operates on.
   There's also something we call the "effective URL" which is the last URL
   curl operated on, like when following a series of redirects. Should we offer
   the same set of variables for that?

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-03-29