Re: bash curl multiple requests same connection
Date: Thu, 12 Mar 2020 18:38:40 +0800
Thank you for your reply。
https://ec.haxx.se/usingcurl/usingcurl-persist :
The curl command-line tool can, however, only keep connections alive for as
long as it runs, so as soon as it exits back to your command line it has to
close down all currently open connections (and also free and clean up all
the other caches it uses to decrease time of subsequent operations)
Creating a TCP connection takes some time
so i want send tow requests use the same connection
The second request needs to be submitted after processing the first
response。
Dan Fandrich via curl-users <curl-users_at_cool.haxx.se> 于2020年3月12日周四
下午6:33写道:
> On Thu, Mar 12, 2020 at 05:55:41PM +0800, taylor park via curl-users wrote:
> > I want use the same connection submitting two URL ,i can use the "--next"
> > option.
> >
> > curl -X "GET" xxxx.com/1 --next -X "POST" -d @file xxxx.com/2
>
> Note that the -X options here are completely unnecessary.
>
> > how can i submit the first URL and submit seconde URL use the same
> connection
> > after deal with some date ?
>
> If you add -v to the command you will see details on whether the
> connection is
> reused or not, e.g., "* Re-using existing connection! (#0) with host
> example.com". It should be if the server supports it. I don't know what
> you
> mean by "deal with some date".
>
> Dan
> -----------------------------------------------------------
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
> Etiquette: https://curl.haxx.se/mail/etiquette.html
>
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2020-03-12