curl-users
Re: multiple POST requests while reusing the TCP connection
Date: Wed, 13 Nov 2013 01:18:17 +0200
On 12.11.2013 19:18, Daniel Stenberg wrote:
> 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...
>
I haven't seen the TODO before.
Actually, I like it more than my proposal (which I haven't given a deep
thought to).
Also, it would be great if it would be supported for the config file as
well. I'm not sure about the colon as a separator, but that's not as
important.
P.S. seems like the post referred in the TODO is from 2004. Wow, 9 years!
-------------------------------------------------------------------
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-13