Re: Outputting URL components

Daniel Stenberg via curl-users <[email protected]>
Newsgroups gmane.comp.web.curl.general
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.