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.

Re: Outputting URL components

From: Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>
Date: Thu, 30 Mar 2023 13:17:09 +0200 (CEST)

On Thu, 30 Mar 2023, Stefan Eissing via curl-users wrote:

> If a tool to use curl's url parsing to check and construct urls is useful,
> why not make it another executable on top of libcurl?

Yes. For something targeting shell-script URL manipulations that is certainly
sensible. A "urler" tool could be made to work like this:

  $ urler --url https://curl.se --host example.com
  https://example.com/

  $ urler --host example.com --scheme ftp
  ftp://example.com

  $ urler --url https://curl.se/we/are.html --redirect here.html
  https://curl.se/we/here.html

  $ urler --url https://curl.se/we/../are.html --port 8080
  https://curl.se:8080/are.html

  $ urler --url https://curl.se/we/are.html --only-path
  /we/are.html

  $ urler --url https://curl.se/we/are.html --only-port
  443

For example.

-- 
  / 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-30