2017 © Pedro Peláez
 

library http

A simple HTTP wrapper around CURL, with request and response classes.

image

rdx/http

A simple HTTP wrapper around CURL, with request and response classes.

  • Wednesday, March 28, 2018
  • by rudiedirkx
  • Repository
  • 1 Watchers
  • 0 Stars
  • 54 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 8 % Grown

The README.md

HTTP

Super simple, very imcomplete, very small wrapper around CURL., (*1)

If you need decent cookie handling, use Guzzle etc., (*2)

Request

GET, (*3)

use rdx\http\HTTP;

$request = HTTP::create('https://api.github.com/gists/public');
$response = $request->request();

POST, (*4)

use rdx\http\HTTP;

HTTP::$_agent = 'Some custom user agent string 1.0';

$request = HTTP::create('https://api.github.com/gists/public', array(
    'method' => 'POST',
    'data' => array('foo' => 'bar'),
    'headers' => array(
        'Authorization: Basic abc',
    ),
    'cookies' => array(
        array('name', 'value'),
    ),
));
$response = $request->request();

Response

var_dump($response->code);   // 200
var_dump($response->status); // OK

print_r($response->cookies_by_name);

The Versions

28/03 2018

dev-master

9999999-dev

A simple HTTP wrapper around CURL, with request and response classes.

  Sources   Download

MIT

by Rudie Dirkx

28/03 2018

1.2

1.2.0.0

A simple HTTP wrapper around CURL, with request and response classes.

  Sources   Download

MIT

by Rudie Dirkx

14/10 2016

1.1

1.1.0.0

A simple HTTP wrapper around CURL, with request and response classes.

  Sources   Download

MIT

by Rudie Dirkx

19/06 2016

1.0

1.0.0.0

A simple HTTP wrapper around CURL, with request and response classes.

  Sources   Download

MIT

by Rudie Dirkx