cURL / Mailing Lists / curl-users / Single Mail

curl-users

Follow up to forum post - trailing slash required on URLs

From: <DavidFilmer_at_Freightliner.com>
Date: Fri, 21 Jan 2005 14:57:44 -0800

Three months ago I posted a commnet in the cURL forum which Daniel responded
to, but I forgot to check back until now...

I reported a problem:

>>> FYI, I don't think this is a bug (it seems to be a syntax anomaly) but
it might confound
>>> some people and prehaps deserves mention in the docs (I didnt't find it
there)...

>>> On my system (AIX/ppc going through an authenticating HTTP proxy
server), if you want to
>>> see the default root document of a webserver, (such as index.html) it
seems you can't
>>> simply say:
>>> curl http://google.com
>>> but you must add a trailing slash (curl http://google.com/). Otherwise,
you get a message:
>>> <html><head><title>Error</title></head><body>The parameter is
incorrect. </body></html>
>>> For some reason, this is not true for https urls;
>>> curl https://verisign.com
>>> returns the root document without using a trailing slash in the command.

Daniel asked that I mail the result of curl -v to this mailing list, so here
it is:

# curl -v http://www.google.com
* Connected to name.of.my.proxy.server.com ((nil))
> GET http://www.google.com HTTP/1.1
Proxy-authorization: Basic ZmVuZ3JhMTp3bcxmYmFuZQ==
User-Agent: curl/7.9.3 (powerpc-ibm-aix4.3.3.0) libcurl 7.9.3 (OpenSSL
0.9.6k)
Host: www.google.com
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

* Closing connection #0
<html><head><title>Error</title></head><body>The parameter is incorrect.
</body></html>#
#

But if I add the trailing slash, I see:

curl -v http://www.google.com/
* Connected to name.of.my.proxy.server.com ((nil))
> GET http://www.google.com/ HTTP/1.1
Proxy-authorization: Basic amVuZ3JhMT83b2xmYmFcZQ==
User-Agent: curl/7.9.3 (powerpc-ibm-aix4.3.3.0) libcurl 7.9.3 (OpenSSL
0.9.6k)
Host: www.google.com
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

<html><head><meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1"><title>Google</title><style><!--
body,td,a,p,.h{font-family:arial,sans-serif;}
... etc, etc (Google's homepage)
Received on 2005-01-22