Relative location header - cURL trying localhost
Posted: Wed Mar 29, 2006 6:54 am
For
I get this :
If I have CURLOPT_FOLLOWLOCATION set to TRUE then it'll try to goto http://localhost/index.asp?cookieTest=true instead of http://domain.com/index.asp?cookieTest=true - any way to make the url absolute isntead of relative ? I thought cURL took care of all this !
Code: Select all
.
.
curl_setopt ($handle, CURLOPT_POSTFIELDS, $Data);
curl_setopt ($handle, CURLOPT_FOLLOWLOCATION, FALSE);
curl_setopt ($handle, CURLOPT_URL, $url);
$c = curl_exec($handle); $Err = curl_errno($handle);Code: Select all
HTTP/1.1 302 Object moved
Date: Wed, 29 Mar 2006 12:46:53 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Location: index.asp?cookieTest=true
Content-Length: 146
Content-Type: text/html
Set-Cookie: ASPSESSIONIDSLRQBTQD=JHMFEOBBLPLPPNJLHAICFHBL; path=/
Cache-control: private
Object Moved
This object may be found here.