cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl command line tool sends always twice

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 16 Mar 2012 13:39:37 +0100 (CET)

On Fri, 16 Mar 2012, shiba doo wrote:

> I am trying to use the curl command line tool to uplad files to a WEBDAV
> server. Unfortunately, the tool sends the files always twice. If I do a
> regular copy/paste within WIndows XP, it does (of course) not do so. Thre
> result is that curl needs double the time to upload the file. I have no idea
> why curl show this behaviour. My string is:
>
> curl --anyauth -u user:password -k -T filenmae
> https://webdav.someserver.com/pictures/ > progressbar.txt

That's because you ask for it. --anyauth will make it "try" the request
without auth first, and being a PUT it then has to continue the full send and
then it gets the 401 back and spots how to do the auth and then it does the
correct PUT with the appropriate auth header.

You can easily avoid the double send by for example specifying the exact auth
method on the command line.

-- 
  / 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 2012-03-16