Skip to content


MIT - 8 1,898
183.8 thousand (month) Apr 28 2019 v7.1.2(8 days ago)
2,992 10 95 NA
Mar 20 2015 447 (month) 0.12.0(6 years 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.

http is an HTTP library for Ruby, it's a fork of the Ruby standard library Net::HTTP. It is designed to provide a more modern and consistent API for making HTTP requests and handling responses.

One of the main goals of http is to simplify the process of making HTTP requests and handling responses. It provides a consistent API for making requests and handling responses across different versions of Ruby and different HTTP libraries, making it easier to write cross-compatible code.

http supports all the standard HTTP methods such as GET, POST, PUT, DELETE, and PATCH, and allows you to set headers, query parameters, and request bodies.

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 'http'

# GET request
response = HTTP.get("")
puts response.body
puts response.status
puts response.headers

# POST request
response ="", json: { title: 'foo', body: 'bar', userId: 1 })
puts response.body

Alternatives / Similar

Was this page helpful?