cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Fwd: Bug#311112: curl: Escape <space> in HTTP requests

From: Carducci, Gerald G <Gerald.G.Carducci_at_bankofamerica.com>
Date: Wed, 01 Jun 2005 21:21:37 -0700

How do I remove myself from this newsgroup; my email account is getting flooded! Help!

-----Original Message-----
From: curl-users-bounces_at_cool.haxx.se
[mailto:curl-users-bounces_at_cool.haxx.se]On Behalf Of Daniel Stenberg
Sent: Sunday, May 29, 2005 11:22 AM
To: libcurl development; curl-users_at_cool.haxx.se
Cc: 311112_at_bugs.debian.org
Subject: Re: Fwd: Bug#311112: curl: Escape <space> in HTTP requests

On Sat, 28 May 2005, Domenico Andreoli wrote:

(This is a reply to the libcurl list that this was sent to, but the report (or
wish actually) regards curl the command line tool. Therefore, this is also
sent to the curl-users list where follow-ups should be taken, if any.)

> For example mp3 files often contain space characters in their
> filename, however curl will not deal with that:

This is very much on purpose.

First, curl operates and URLs and spaces are not part of legal URLs.

curl is as liberal as possible to what URLs it accepts and lets through (as
long as it can extract the host name etc). It allows users to send lots of
weird things through to servers.

Having curl translate illegal letters into something else would take a lot of
effort and "intelligence" in the tool I much rather avoid. Is translation to
%20 *always* wanted when you pass a space in the URL? I doubt that.

Also (of course) different servers and different protocols will treat that
literal space differently.

> Of course *I* could do the escaping and invoke curl
> 'http://downhill.aus.cc/testingcurl/with%20space'

That is what you are expected to do. If you want a %20 sent to a HTTP server.

> however in that case I'll end up with a file named "with%20space" locally if
> I use -O and will need to do manual de-escaping with mmv, too.

Yes, but if you don't like what -O gives you, why not use -o and intent your
own file name?

-- 
          -=- Daniel Stenberg -=- http://daniel.haxx.se -=-
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Received on 2005-06-02