PHPackages                             mikecbrant/php-rest-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. mikecbrant/php-rest-client

ActiveLibrary[Testing &amp; Quality](/categories/testing)

mikecbrant/php-rest-client
==========================

PSR-4 PHP Package Boilerplate.

1117.2k2PHP

Since Jun 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mikecbrant/php-rest-client)[ Packagist](https://packagist.org/packages/mikecbrant/php-rest-client)[ RSS](/packages/mikecbrant-php-rest-client/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/de2aa2f7637ad628419ddf475647b8a1e2be21945907ac31dea030309e166ae7/68747470733a2f2f7472617669732d63692e6f72672f6d696b65636272616e742f7068702d726573742d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mikecbrant/php-rest-client)[![Code Climate](https://camo.githubusercontent.com/f6954730495170ccb5c78206316bebeed16265f6de00f8040d3b90e30fc56000/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d696b65636272616e742f7068702d726573742d636c69656e742f6261646765732f6770612e737667)](https://codeclimate.com/github/mikecbrant/php-rest-client)[![Test Coverage](https://camo.githubusercontent.com/fa5556efc927dc11b7caceec77073cb5353abbc163296c8db3a6933e94d6234e/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d696b65636272616e742f7068702d726573742d636c69656e742f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/mikecbrant/php-rest-client/coverage)

php-rest-client
===============

[](#php-rest-client)

This library provides classes implementing basic REST clients based on PHP's cURL extension. Two client classes are made available:

- [RestClient](docs/MikeBrant-RestClientLib-RestClient.md) - a class for executing RESTful service calls.
- [RestMultiClient](docs/MikeBrant-RestClientLib-RestMultiClient.md) - a class which extends RestClient to provide curl\_multi capabilities to allow multiple RESTful calls to be made in parallel.

Additionally, this library provides classes which wrap curl responses within object oriented interface:

- [CurlHttpResponse](docs/MikeBrant-RestClientLib-CurlHttpResponse.md) - a class which encapsulates an HTTP response received via cURL into a class wrapper.
- [CurlMultiHttpResponse](docs/MikeBrant-RestClientLib-CurlMultiHttpResponse.md) - a class which represents a collection of CurlHttpRepsonse objects as returned from multiple parallel cURL calls.

These classes support:

- HTTP actions - GET, POST, PUT, DELETE, and HEAD
- Basic authentication
- SSL, with the ability to toggle SSL certificate validation to help in development/test enviroments

Requires:

- PHP 5.6+
- PHP cURL extension
- PHPUnit 5.7+ (for unit tests only)

This library is developed against PHP 7.1 and tested via Travis CI against:

- PHP 5.6.\*
- PHP 7.0.\*
- PHP 7.1.\*
- PHP Nightly build

[Full library documentation](/docs/RestClientLib.md)

[Travis CI build status](https://travis-ci.org/mikecbrant/php-rest-client)

[Code Climate code coverage and health information](https://codeclimate.com/github/mikecbrant/php-rest-client)

[Packagist page](https://packagist.org/packages/mikecbrant/php-rest-client)

**Usage example:**

```
