cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Not able to follow redirections

From: Gowranga <gowranga_at_serc.iisc.ernet.in>
Date: Thu, 14 Jun 2007 17:30:01 +0530 (IST)

> On Thu, 14 Jun 2007, Gowranga wrote:
>
>> HTTP/1.x 404 Not Found
>
> ...
>
>> HTTP/1.x 404 Not Found
>
> 404 is not a redirect response...
>

I have included header and verbose options, and the run now gives response
on LiveHTTPheaders as

http://my.ip.add.ress/google/

GET /google/ HTTP/1.1
Host: my.ip.add.ress
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4)
Gecko/20070515 Firefox/2.0.0.4
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: PHPSESSID=dcb7956673d840c68711b0736b1602b2
Authorization: Basic Zmx1ZW50X3VzZXI6dHJ5XzVmdA==

HTTP/1.x 200 OK
Transfer-Encoding: chunked
Date: Thu, 14 Jun 2007 11:46:09 GMT
Server: Apache/2.0.59 (Unix)
X-Powered-By: PHP/5.2.0
--------------: ----
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
----------------------------------------------------------

and the response on the browser is

Array ( [url] => http://www.google.co.in/
[content_type] => text/html; charset=UTF-8
[http_code] => 200 [header_size] => 473 [request_size] => 681
[filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 1
[total_time] => 1.803989 [namelookup_time] => 2.6E-05
[connect_time] => 0.000371 [pretransfer_time] => 0.000409
[size_upload] => 0 [size_download] => 4042 [speed_download] => 2240
[speed_upload] => 0 [download_content_length] => 221
[upload_content_length] => 0 [starttransfer_time] => 0.917049
[redirect_time] => 0.885959 )

cURL error number:0 cURL error:HTTP/1.0 302 Moved Temporarily Location:
http://www.google.co.in/ Cache-Control: private Content-Type: text/html
Server: GWS/2.1 Content-Length: 221 Date: Thu, 14 Jun 2007 11:33:49 GMT
X-Cache: MISS from xx2.xx.xx.xx Proxy-Connection: close HTTP/1.0 200 OK
Cache-Control: private Content-Type: text/html; charset=UTF-8 Server:
GWS/2.1 Date: Thu, 14 Jun 2007 11:33:50 GMT X-Cache: MISS from
xx2.xx.xx.xx Proxy-Connection: close

The URL on the browser however has not changed to the remote site.

Thanks

-gowranga

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-06-14