Performing simple HTTP requests is very easily done using the request() method, and rarely needs more than three lines of code:
Example 460. Performing a Simple GET Request
<?php
$client = new Zend_Http_Client('http://example.org');
$response = $client->request();
The request() method takes one optional parameter - the request method.
This can be either GET, POST,
PUT, HEAD, DELETE,
TRACE, OPTIONS or CONNECT
as defined by the HTTP protocol
[6].
For convenience, these are all defined as class constants:
Zend_Http_Client::GET, Zend_Http_Client::POST and so on.
If no method is specified, the method set by the last
setMethod() call is used. If
setMethod() was never called, the default request
method is GET (see the above example).
Example 461. Using Request Methods Other Than GET
<?php
// Preforming a POST request
$response = $client->request('POST');
// Yet another way of preforming a POST request
$client->setMethod(Zend_Http_Client::POST);
$response = $client->request();




