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.
[PROPOSAL] URL shortcuts
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>
Date: Fri, 21 Jan 2022 09:22:58 +0100 (CET)
Hello,
Let me bring up another small proposal I picked up from previous twitter
reply, and see what you all think.
The URL shortcut. The intent is here primarily to save keystrokes for commonly
repeated URLs for users doing repeated curl command lines with variations.
(Again a thing for the command line tool only.)
A "URL" that starts with colon (thereby not being a URL at all so the command
line parser can easily catch when this happens), implies a "http://localhost"
prefix. Like this:
$ curl :80/
$ curl :8080/index.html
$ curl :/search.cgi?q=crazy
The difference from hacks like where you use 0 as in "curl 0:80/", the 0 thing
is IPv4-only and it doesn't pass on the hostname. Also, we don't really
document the 0 trick anywhere, where as the colon-thing would be a supported
features.
Since this would introduce this idea of a shortcut that isn't really a URL
when input but gets translated into one when used, it would open up the
opportunity to do *other* shortcuts or URL trickeries on the command line. I
can't say that I have managed to come up with any suitable additional
alternatives.
Date: Fri, 21 Jan 2022 09:22:58 +0100 (CET)
Hello,
Let me bring up another small proposal I picked up from previous twitter
reply, and see what you all think.
The URL shortcut. The intent is here primarily to save keystrokes for commonly
repeated URLs for users doing repeated curl command lines with variations.
(Again a thing for the command line tool only.)
A "URL" that starts with colon (thereby not being a URL at all so the command
line parser can easily catch when this happens), implies a "http://localhost"
prefix. Like this:
$ curl :80/
$ curl :8080/index.html
$ curl :/search.cgi?q=crazy
The difference from hacks like where you use 0 as in "curl 0:80/", the 0 thing
is IPv4-only and it doesn't pass on the hostname. Also, we don't really
document the 0 trick anywhere, where as the colon-thing would be a supported
features.
Since this would introduce this idea of a shortcut that isn't really a URL
when input but gets translated into one when used, it would open up the
opportunity to do *other* shortcuts or URL trickeries on the command line. I
can't say that I have managed to come up with any suitable additional
alternatives.
-- / 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/listinfo/curl-users Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2022-01-21