cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl HTTP PUT to a URL ending in "/"

From: Doug McNutt <douglist_at_macnauchtan.com>
Date: Fri, 16 Jan 2009 09:01:25 -0700

At 15:32 +0000 1/16/09, Toby White wrote:
>I want to PUT to the URL
>
> http://example.org/path/
>
>but curl won't seem to let me.
>
>If I do the obvious
>
> curl -T filename http://example.org/path/
>
>then curl actually tries to do the PUT on
>
> http://example.org/path/filename
>
>which is not what I want - I want the PUT request to go directly to
>the URL I've asked for.

To me, and to the ftp:// URLs I use all of the time, the trailing
slash after "path" in your URL indicates that path is a directory.

Actually I would think that the transmission should fail if a
directory path does not exist. HTTP might default to creating the
directory.

And, at least in UNIX, a file name simply cannot end in a slash. Is
the host a UNIX server? If not you might try some quotes or a URL
encoded solidus.

-- 
--> From the U S of A, the only socialist country that refuses to admit it. <--
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-01-16