PHPackages                             sc0/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. [HTTP &amp; Networking](/categories/http)
4. /
5. sc0/rest-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

sc0/rest-client
===============

Simple PHP Rest Client

2.3.1(8mo ago)210.9k↓100%3MITPHPPHP &gt;=8.1

Since Dec 30Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/sc0rp10/rest-client)[ Packagist](https://packagist.org/packages/sc0/rest-client)[ Docs](https://github.com/sc0rp10/rest-client)[ RSS](/packages/sc0-rest-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (12)Used By (0)

PHP REST client
===============

[](#php-rest-client)

[![Build Status](https://camo.githubusercontent.com/c57717fb051a8240cd9a2e978219b929e813e50e7b1650c434004a4938f1d72e/68747470733a2f2f7472617669732d63692e6f72672f736330727031302f726573742d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/sc0rp10/rest-client)

[![SensioLabsInsight](https://camo.githubusercontent.com/4a03a466316d213dd3fd15f2058a6d560853e7c8197c61adb729818bae1d9e2b/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62626662663261362d643862382d343966652d396330332d3564633365346562316632392f6269672e706e673f31)](https://insight.sensiolabs.com/projects/bbfbf2a6-d8b8-49fe-9c03-5dc3e4eb1f29)

This is simple and extendable REST client.

Basic usage
-----------

[](#basic-usage)

```
use Sc\RestClient\Client\Client;
use Sc\RestClient\ResponseParser\JsonResponseParser;

$client = new Client('https://api.foo.bar', new JsonResponseParser());

$resource = 'zombies';

// retrieve all objects (will produce GET /zombies/)
$client->getAll($resource);

// create a new resource (will produce POST /zombies/ with following data)
$created = $client->create($resource, [
    'name' => 'Shaun',
    'age' => 29,
]);
// 'create' API should return data or 'Location' header with created resource URI

$id = $created['id'];

// retrieve single object (will produce GET /zombies/123/)
$client->get($resource, $id);

// update full resource (will produce PUT /zombies/123/)
$updated = $client->update($resource, $id, [
	'name' => 'Shaun',
	'age' => 30,
]);

// update resource partially (will produce PATCH /zombies/123/)
$updated = $client->update($resource, $id, [
	'age' => 31,
]);

// delete resource (will produce DELETE /zombies/123/)
$client->delete($resource, $id);
```

Change response format
----------------------

[](#change-response-format)

```
use Sc\RestClient\Client\Client;
use Sc\RestClient\ResponseParser\XmlResponseParser;

$client = new Client('https://api.foo.bar', new XmlResponseParser('root_tag_name'));
```

### Implementing own response parser

[](#implementing-own-response-parser)

Just implement `Sc\RestClient\ResponseParser\ResponseParserInterface#parseResponse` and play with response

Custom api authentification
---------------------------

[](#custom-api-authentification)

```
use Sc\RestClient\Client\Client;
use Sc\RestClient\ResponseParser\JsonResponseParser;
use Sc\RestClient\AuthenticationProvider\QueryParameterProvider;
use Sc\RestClient\AuthenticationProvider\HeaderProvider

$client = new Client('https://api.foo.bar', new JsonResponseParser());
$client->useAuthenticator(new QueryParameterProvider('api_key', 'abcd1234'));
// each request will be followed with ?api_key=abcd1234 query string

// or
$client->useAuthenticator(new HeaderProvider('X-Auth-Header', 'abcd1234'));
// each request will be followed with header "X-Auth-Header: abcd1234"
```

### Implementing own authenticator

[](#implementing-own-authenticator)

`Sc\RestClient\AuthenticationProvider\AuthenticationProviderInterface#addAuthentificationInfo` will play with original request and modify it according with your requirements such as X.509 certificates

Request signing
---------------

[](#request-signing)

@TODO

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance63

Regular maintenance activity

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 94.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~352 days

Recently: every ~287 days

Total

11

Last Release

258d ago

Major Versions

0.2.0 → 1.0.02022-02-14

1.0.0 → 2.0.02022-07-04

PHP version history (2 changes)0.0.1PHP &gt;=5.6

1.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/05412073e9ab3b583dff0ed26b1d30504692d9a514faae652f0262a88aa92075?d=identicon)[sc0rp10](/maintainers/sc0rp10)

---

Top Contributors

[![sc0rp10](https://avatars.githubusercontent.com/u/597762?v=4)](https://github.com/sc0rp10 "sc0rp10 (34 commits)")[![Icewild](https://avatars.githubusercontent.com/u/8243173?v=4)](https://github.com/Icewild "Icewild (2 commits)")

---

Tags

restrest-client

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sc0-rest-client/health.svg)

```
[![Health](https://phpackages.com/badges/sc0-rest-client/health.svg)](https://phpackages.com/packages/sc0-rest-client)
```

###  Alternatives

[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.3M14](/packages/xeroapi-xero-php-oauth2)[cybercog/youtrack-rest-php

YouTrack REST API PHP Client.

37149.2k3](/packages/cybercog-youtrack-rest-php)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[ory/hydra-client

Documentation for all of Ory Hydra's APIs.

17435.9k](/packages/ory-hydra-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
