Re: HTTP_Request
| From: | Ian Warner | Date: | Tue, 25 Jul 2006 11:32:41 +0000 |
| Subject: | Re: HTTP_Request | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-43566@lists.php.net to get a copy of this message | ||
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.
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