cURL / Mailing Lists / curl-users / Single Mail

curl-users

Curl error 7 and -L option

From: eddj <eddj_at_kdcgroup.cjb.net>
Date: Thu, 17 Feb 2000 18:43:54 +0100 (CET)

There's something strange in the -L (follow location) option.

Here is a response form a post request (verbose) without -L:

----------------------------------------------------------------
* Connected to homer.cineca.it (193.204.121.70)
> POST http://some.site.it/requested-url.asp HTTP/1.0
User-Agent: 'Mozilla/4.6 [en] (WinNT; I) via NetCache version
3.1.1d-Solaris'^M
Host: some.site.it
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> Content-Length: 92
Content-Type: application/x-www-form-urlencoded

data1=val1&data2=val2&data3=val3
* 303 bytes transfered in 3.604 seconds (84 bytes/sec).
-------------------------------------------------------------

curl exits without errors, and the output file seems like:

-------------------------------------------------------------
<head><title>Object moved</title></head>
<body><h1>Object Moved</h1>This object may be found <a
HREF="another-url.asp?par1=val1&par2=val2&par3=val3">here</a>.
</body>
------------------------------------------------------------

If I try with the -L option:

* Connected to homer.cineca.it (193.204.121.70)
> POST http://some.site.it/requested-url.asp HTTP/1.0
User-Agent: 'Mozilla/4.6 [en] (WinNT; I) via NetCache version
3.1.1d-Solaris'
Host: some.site.it
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
> Content-Length: 92
Content-Type: application/x-www-form-urlencoded

data1=val1&data2=val2&data3=val3
* Follow to new URL:
another-url.asp?param1=val1&param2=val2&param3=val3

* Follows Location: to new URL:
'http://some.site.it/another-url.asp?param1=val1&param2=val2&param3=val3
curl: (7) Connection refused
------------------------------------------------------------

curl exits with error 7 and output file is not saved.

What about it?

ThanX

eddj
Received on 2000-02-17