cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: multiple POST requests while reusing the TCP connection

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 12 Nov 2013 18:18:35 +0100 (CET)

On Thu, 7 Nov 2013, JustAn0therAcc0unt wrote:

>>> But instead of separating the -d arguments per request, it just adds them
>>> together.
>>>
>>> Is there any way to achieve what I want with cURL?
>>
>> Nope. We've previously discussed adding that ability but so far we haven't.
>
> I think such an option can be very helpful in multiple scenarios. And not
> only for post fields, but for other switches such as cookies or referer,
> too.

Yeps. This is actually what is referred to as "url-specific options" in the
TODO:

    http://curl.haxx.se/docs/todo.html#url_specific_options

> I suggest changing the strategy to the following: parse the command line
> arguments until an URL is met, make a request with what you've got so far,
> then continue parsing until you see a second URL (overwriting any options,
> not appending), and so on. Then, the command line I suggested in my first
> message will work.
>
> Of course, such workflow is not backwards compatible, so you might want to
> introduce a command line switch to change it, e.g. --new-cmdline-parsing
> (which will probably have to be the first switch). Or you might want to
> introduce it in a major release.

I would prefer something similar to what the TODO mentions. Basically a
separator that says everything before this separate is done on the given URL,
and after the separator we start a new request with this new set of options.
Then we could easily also support mixed GET + POST + HEAD operations over the
same connection when a user would like that...

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-11-12