curl / Mailing Lists / curl-users / Single Mail


URL parsing for the command line tool?

From: Daniel Stenberg <>
Date: Thu, 9 Aug 2018 15:57:32 +0200 (CEST)


In a future libcurl release, there is going to be a URL parsing/handling API
[1] added. It can parse URLs, allow access to parts of the URL, setting or
updating specific parts and can "merge" a relative URL onto an absolute one.

Do you think the command line tool would benefit from offering these services
somehow? If so, how? What you like curl to help your scripts or shells with in
this regard?

Extract the different parts from a URL? Maybe like this?

   curl --url-input $in --url-out "%{host} %{path}\n"

Maybe change parts of a URL and output the new version?

   curl --url-input $in --url-replace "" --url-out "%{url}\n"

Perhaps applying a relative path onto an absolute URL and show the resulting
path part?

   curl --url-input $in --url-new "../index?nooo" --url-out "%{path}\n"

I'm just brain-storming here.

[1] =

Received on 2018-08-09