2017 © Pedro Peláez
 

library http_request2

Provides an easy way to perform HTTP requests.

image

findologic/http_request2

Provides an easy way to perform HTTP requests.

  • Wednesday, December 20, 2017
  • by g.sorst@findologic.com
  • Repository
  • 2 Watchers
  • 0 Stars
  • 751 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 33 Forks
  • 1 Open issues
  • 9 Versions
  • 16 % Grown

The README.md

HTTP_Request2

Build Status, (*1)


DISCLAMER! This project is no longer actively maintained and only updated if future PHP versions break compatibility., (*2)

If for any reason you want to use this project, use Guzzle instead. It is much better, maintained, has many more features and is generally speaking the way to go if you want to send HTTP requests with PHP., (*3)


Provides an easy way to perform HTTP requests, uses pluggable adapters, (*4)

  • Socket: pure PHP implementation of HTTP protocol (does not use http stream wrapper), based on older PEAR HTTP_Request package
  • Curl: wrapper around PHP's cURL extension
  • Mock: used for testing packages depending on HTTP_Request2, returns predefined responses without network interaction

Both Socket and Curl adapters support POST requests with data and file uploads, basic and digest authentication, cookies, managing cookies across requests, HTTP and SOCKS5 proxies, gzip and deflate encodings, redirects, monitoring the request progress with Observers..., (*5)

This package is PEAR HTTP_Request2 and has been migrated from PEAR SVN, (*6)

Please report all issues via the [PEAR bug tracker]., (*7)

Pull requests are welcome., (*8)

Basic usage

require_once 'HTTP/Request2.php';

$request = new HTTP_Request2('http://pear.php.net/', HTTP_Request2::METHOD_GET);
try {
    $response = $request->send();
    if (200 == $response->getStatus()) {
        echo $response->getBody();
    } else {
        echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
             $response->getReasonPhrase();
    }
} catch (HTTP_Request2_Exception $e) {
    echo 'Error: ' . $e->getMessage();
}

Documentation

...is available on PEAR website, (*9)

Generated API documentation for the current release is also there., (*10)

Testing, Packaging and Installing (Pear)

To test, run either, (*11)

$ phpunit tests/

or, (*12)

$ pear run-tests -r

You may need to set up the NetworkConfig.php file if you want to perform tests that interact with a web server. Its template is NetworkConfig.php.dist file, consult it for the details., (*13)

To build, simply, (*14)

$ pear package

To install from scratch, (*15)

$ pear install package.xml

To upgrade, (*16)

$ pear upgrade -f package.xml

The Versions

20/12 2017

dev-namespaces

dev-namespaces https://github.com/findologic/HTTP_Request2

Provides an easy way to perform HTTP requests.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Alexey Borzov

curl http request pear

28/08 2017

dev-trunk

9999999-dev https://github.com/findologic/HTTP_Request2

Provides an easy way to perform HTTP requests.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Borzov

curl http request pear

28/08 2017

dev-large_download_support

dev-large_download_support https://github.com/findologic/HTTP_Request2

Provides an easy way to perform HTTP requests.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Borzov

curl http request pear

28/08 2017

v2.3.1

2.3.1.0 https://github.com/findologic/HTTP_Request2

Provides an easy way to perform HTTP requests.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Borzov

curl http request pear

13/02 2016

v2.3.0

2.3.0.0 http://pear.php.net/package/HTTP_Request2

Provides an easy way to perform HTTP requests.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Borzov

curl http request pear

20/06 2015

dev-delian-observer

dev-delian-observer http://pear.php.net/package/HTTP_Request2

Provides an easy way to perform HTTP requests.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Borzov

curl http request pear

18/02 2014

dev-topics/composer-for-pear

dev-topics/composer-for-pear http://pear.php.net/package/HTTP_Request2

Provides an easy way to perform HTTP requests.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Alexey Borzov

curl http request pear

16/01 2014

v2.2.1

2.2.1.0 http://pear.php.net/package/HTTP_Request2

Provides an easy way to perform HTTP requests.

  Sources   Download

BSD-3-Clause

The Requires

 

by Alexey Borzov

curl http request pear

12/01 2014

v2.2.0

2.2.0.0 https://github.com/pear/HTTP_Request2

Provides an easy way to perform HTTP requests.

  Sources   Download

BSD-2-Clause

The Requires

 

by Alexey Borzov

http request