Re: HTTP_Request question

From: Date: Wed, 09 Oct 2002 02:02:47 +0000
Subject: Re: HTTP_Request question
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-2460@lists.php.net to get a copy of this message
Hello, A precision about my previous message. using $req->addRawQueryString($myQuery); I get as response headers : $req->getResponseHeader() : Array (
    [Date] => Wed, 09 Oct 2002 01:59:11 GMT
    [date] => Wed, 09 Oct 2002 01:59:11 GMT
    [Server] => Stronghold/2.4.2 Apache/1.3.6 C2NetEU/2412 (Unix)
    [server] => Stronghold/2.4.2 Apache/1.3.6 C2NetEU/2412 (Unix)
    [Location] => http://www.amazon.fr/exec/obidos/external-search/402-7425534-1824936?mode=blended&keyword=photo&tag=regardnumeriq-21
    [location] => http://www.amazon.fr/exec/obidos/external-search/402-7425534-1824936?mode=blended&keyword=photo&tag=regardnumeriq-21
    [Connection] => close
    [connection] => close
    [Transfer-Encoding] => chunked
    [transfer-encoding] => chunked
    [Content-Type] => text/html
    [content-type] => text/html
) The resulting URL is OK but I get no page content with echo $req->getResponseBody(); Luc At 03:36 09/10/2002 +0200, Luc Saint-Elie wrote:
Hello, I'm building a script to fetch amazon references with associateID included. HTTP_Request works perfectly well for classic urls but I fail to get complex ones like : http://www.amazon.fr/exec/obidos/external-search/402-6440735-3075348?mode=blended&keyword=photo&tag=regardnumeriq-21302 The following (simplified ) bit of code doesn't return anything (except an empty array): function createURL() {
        $url= $baseURL.
        "?mode=".$_POST['mode'].
        "&keyword=".rawurlencode($_POST['keyword']).
        "&tag=$affiliateID";
        return $url;
}
        $req =& new HTTP_Request($url);
        $req->sendRequest();
        // just for control
        echo $req->getResponseCode();
        echo $req->getResponseHeader($headername = null);
        // get the page
        echo $req->getResponseBody();
Any ideas ? Thanks in advance Luc -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pear.general (#2460) next »