Skip to content


MIT - 8 1,898
183.8 thousand (month) Apr 28 2019 v7.1.2(8 days ago)
1,154 19 27 MIT
Oct 31 2009 2.8 million (month) 0.110.0(3 months ago)

Symfony-http is a PHP library that provides a set of classes for working with HTTP requests and responses. It is part of the Symfony CMS framework, but can also be used independently.

Excon is a Ruby library for making HTTP requests. It is designed to be fast and efficient, and is often used as a building block for other Ruby libraries and frameworks.

One of the main features of Excon is its support for persistent connections, which allows it to reuse the same connection for multiple requests, reducing the overhead of establishing a new connection for each request.

Excon also supports streaming requests and responses, which allows you to read or write data to the server incrementally, without having to load the entire response into memory at once.

Example Use

use Symfony\Component\HttpClient\HttpClient;

// create a client object: 
$client = HttpClient::create();
// sent GET request
$response = $client->request('GET', '');

// or POST request
$response = $client->request('POST', '', [
    'headers' => [
        'Content-Type' => 'application/json',
    'json' => [
        'name' => 'John Doe',
        'email' => '',

// print response data:
$statusCode = $response->getStatusCode();
$content = $response->getContent();
echo "Status Code: $statusCode\n";
echo "Content: $content\n";
require 'excon'

# GET requests
response = Excon.get('')
puts response.body
puts response.status
puts response.headers

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

Alternatives / Similar

Was this page helpful?