curl-users
An idea on separate options for different URLs
Date: Sat, 31 Jul 2004 23:09:45 +0200 (CEST)
Hi
I would like to enhance the tool curl to make it able to deal with options set
to specific URLs, so that we can make multiple requests easily, using a single
command line (and thus use persistent connections etc).
It struck me the other day that perhaps the best way to support this, would be
to introduce a totally new kind of separator that is not an option (that
starts with - or --) and not a URL (that would start with a letter or number),
but perhaps should be something like... ':'! (Picked because it is not special
to most shells, such as '!', '#', '&' or different parentheses etc are).
I realize this is totally unorthodox but it isn't an option, it just separates
options, and it isn't a URL...
Let me give you a few examples, to show you how it would work:
make a POST, a GET and then a HEAD:
curl -d "moo" URL1 : URL2 : -I URL3
make an upload then download it:
curl -T uploadthisfile URL : URL
you could still do multiple URLs in each part, like to download three URLs,
then upload two files:
curl URL1 URL2 URL3 : -T file[1-2] URL4
... each ':' would reset all options so you need to repeat options you want
for all "sections". Like if you want to do a GET and a HEAD, both using the
verbose option:
curl -v URL1 : -I -v URL2
Or can anyone come up with a better separator? Or even a better system that is
easier to use?
I'm interested in your feedback!
-- Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se Dedicated custom curl help for hire: http://haxx.se/curl.htmlReceived on 2004-07-31