Download the PHP package manuman85/hal-client without Composer
On this page you can find all versions of the php package manuman85/hal-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package hal-client
HalClient
A lightweight PHP client for consuming and manipulating Hypertext Application Language (HAL) resources.
- Installation
- Usage
- License
Installation
Install the latest version with Composer.
Check the Packagist page for all available versions.
HTTP Client dependency
The Hal client requires a HttpClientInterface implementation which can handle PSR-7 requests and responses.
To use the default implementations shipped with this library, you need to install Guzzle 7, 6 or 5.
Usage
We will use Propilex as an example API endpoint.
Create the client
At a first step, we setup a HalClient
instance.
We can now set additional headers (eg. an Authorization header) which are sent with every request.
Note, that a client instance is immutable, which means, any call to change the state of the instance returns a new instance leaving the original instance unchanged.
Browse the API
To start browsing through the API, we first get the root resource.
We now follow the p:documents
link.
If there is a second page with more documents, we can follow the next
link.
Ok, let's create a new document.
Oh noes! A typo in the document title. Let's fix it.
Damn, we give up.
License
Copyright (c) 2015-2021 Jan Sorgalla. Released under the MIT License.
All versions of hal-client with dependencies
ext-json Version *
psr/http-message Version ^1.0
guzzlehttp/psr7 Version ^2.0
guzzlehttp/uri-template Version ^1.0