Skip to content


MIT 12 2 1,918
6.4 thousand (month) Nov 11 2011 1.2.1(1 year, 10 months ago)
5,732 8 58 MIT
0.21.0(1 year, 1 month ago) Jul 25 2009 1.7 million (month)

Buzz is a lightweight PHP library for issuing HTTP requests. It is built on top of the PHP curl extension and is designed to be easy to use and flexible.

While buzz isn't as feature rich as other clients it still supports http2 and is relatively easy to use.

HTTParty is a Ruby library that makes it easy to work with HTTP requests and responses. It is built on top of the Ruby standard library's Net::HTTP and provides a simple, easy-to-use interface for making requests and handling responses.

One of the main features of HTTParty is its ability to automatically parse response bodies as JSON, XML, or other formats. This allows developers to easily access the data returned by an API without having to manually parse the response.



Example Use

use Buzz\Client\Curl;
use Buzz\Message\Request;
use Buzz\Message\Response;

$client = new Curl();
// GET request
$request = new Request('GET', '');
$response = new Response();
$client->send($request, $response);
echo $response->getContent();

//POST request
$request = new Request('POST', '/api/resource', '');
$request->setContent(json_encode(['name' => 'John Doe']));
// we can also add headers or cookies:
$request->addHeader('Content-Type: application/json');
$request->addHeader('Cookie: name=foobar');
$response = new Response();
$client->send($request, $response);
echo $response->getContent();

// Buzz also supports http2 (see the 2.0 parameter)
$response = $client->sendRequest(
  new Request('GET', '', [], null, '2.0')
require 'httparty'

# get request:
response = HTTParty.get('')
puts response.body
puts response.code
puts response.message
puts response.headers.inspect

# post request
response ='',
  :body => { :title => 'foo', :body => 'bar', :userId => 1 }.to_json,
  :headers => { 'Content-Type' => 'application/json' } )

puts response.body

Alternatives / Similar