PHPackages                             tomphp/hal-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. tomphp/hal-client

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

tomphp/hal-client
=================

A client library for navigating HAL APIs

v0.1.1(11y ago)343MITPHPPHP &gt;=5.5

Since Mar 31Pushed 9y ago1 watchersCompare

[ Source](https://github.com/tomphp/hal-client)[ Packagist](https://packagist.org/packages/tomphp/hal-client)[ Docs](https://github.com/tomphp/hal-client)[ RSS](/packages/tomphp-hal-client/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (8)Versions (5)Used By (0)

HalClient
=========

[](#halclient)

[![Build Status](https://camo.githubusercontent.com/e73d7eabd5b164cb0b0a2e48af52724d4356759fac06f258c45750cf435188aa/68747470733a2f2f6170692e7472617669732d63692e6f72672f746f6d7068702f68616c2d636c69656e742e737667)](https://travis-ci.org/tomphp/hal-client)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c9bef6e07affbe2d17815f2b62254a51c36cc1cbb46f654c4e0426999dc8ae04/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746f6d7068702f68616c2d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tomphp/hal-client/?branch=master)[![Build Status](https://camo.githubusercontent.com/5b10212fd6266a8459c26b2b321ab34a80be31a56c24dc0372d6629a54114d65/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746f6d7068702f68616c2d636c69656e742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tomphp/hal-client/build-status/master)

A client library for navigating HAL APIs.

Installation
------------

[](#installation)

**This library is currently in an early development stage. Many things are subject to change**

```
$ composer require tomphp/hal-client

```

Example
-------

[](#example)

Given an API which looks like this:

**GET **

```
{
    "_links": {
        "self": {
            "href": "http://api.demo-cocktails.com/recipes"
        }
    },
    "count": 3,
    "_embedded": {
        "recipes": [
            {
                "_links": {
                    "self": {
                        "href": "http://api.demo-cocktails.com/recipes/1"
                    }
                },
                "name": "Mojito"
            },
            {
                "_links": {
                    "self": {
                        "href": "http://api.demo-cocktails.com/recipes/2"
                    }
                },
                "name": "Pina Colada"
            },
            {
                "_links": {
                    "self": {
                        "href": "http://api.demo-cocktails.com/recipes/3"
                    }
                },
                "name": "Daquiri"
            }
        ]
    }
}
```

**GET **

```
{
    "_links": {
        "self": {
            "href": "http://api.demo-cocktails.com/recipes/1"
        }
    },
    "name": "Mojito",
    "rating": 5,
    "ingredients": [
        {"name": "White Rum"},
        {"name": "Soda"},
        {"name": "Lime Juice"},
        {"name": "Sugar"},
        {"name": "Mint Leaves"}
    ]
}
```

```
