Re: Re: HTTP_Request

From: Date: Tue, 25 Jul 2006 15:11:32 +0000
Subject: Re: Re: HTTP_Request
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-43570@lists.php.net to get a copy of this message
Justin Thanks so the listener gives me an output of the send - I will try this. I sent once to each of the General and Dev newsletters. so you may have received twice. Ian Regards Ian Warner Director Triangle Solutions Ltd http://www.triangle-solutions.com/ Skype: TAG: iwarner_uk <callto:iwarner_uk> TEL: +44 (207) 7871 2394 <callto:+4420778712394> Japan: TEL: +81 (3) 5261 5572 <callto:+81352615572> FAX: +81 (3) 5261 5572 <callto:+81352615572> MOB: +81 (90) 9312 1341 <callto:+819093121341> UK: TEL: +44 (1342) 311 923 <callto:+441342311923> MOB: +44 (7980) 615 878 <callto:+447980615878> ©2000-2006 Triangle Solutions Ltd. - All rights reserved Justin Patrin wrote:
On 7/25/06, Ian Warner <iwarner@triangle-solutions.com> wrote:
Further to this I need to POST some data without a Name The docs say to use addBody but this doesnt exist - I have tried addRawPostData also and the below
         if ($params['method'] == 'POST') {
             foreach ($url as $k => $v) {
                 $req->setBody($k);
             }
each time it errors and says it cant open the URL. again would be nice if I could see what http_request is actually posting.
You sent each of these e-mails twice. addRawPostData() is the function you want. You can use a listener. See the examples/listener class.
Ian Warner wrote:
Hi Is there any way to print out exactly what HTTP Request is posting? A sort of debug for this package? Also the PUT command how should the data to be sent be allocated to
the
send?
        // If method is POST then use the addPostData otherwise it
should be
        // addQueryString for GET command.
        if ($params['method'] == 'POST') {
            foreach ($url as $k => $v) {
                $req->addPostData($k, $v);
            }
        } elseif ($params['method'] == 'GET') {
            foreach ($url as $k => $v) {
                $req->addQueryString($k, $v);
            }
        } elseif ($params['method'] == 'PUT') {
            foreach ($url as $k) {
                $req->addQueryString($k);
            }
        }
Cheers Ian
-- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pear.dev (#43570) next »