PHP 5.3's lightweight HTTP client
Pull request Compare This branch is even with dsyph3r:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Buzz is a lightweight PHP 5.3 library for issuing HTTP requests.

$browser = new Buzz\Browser();
$response = $browser->get('');

echo $browser->getJournal()->getLastRequest()."\n";
echo $response;

You can also use the low-level HTTP classes directly.

use Buzz\Message;
use Buzz\Client;

$request = new Message\Request('HEAD', '/', '');
$response = new Message\Response();

$client = new Client\FileGetContents();
$client->send($request, $response);

echo $request;
echo $response;

Before doing any of this you need to register the Buzz class loader.

require_once 'Buzz/ClassLoader.php';

Buzz is tested using PHPUnit. The run the test suite, execute the following command:

$ phpunit test/