PHPackages                             joseluisq/guztav - 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. joseluisq/guztav

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

joseluisq/guztav
================

A small RESTful API client around PHP Guzzle

1.0.2(9y ago)025MITPHPPHP &gt;=7.0

Since Apr 3Pushed 9y ago2 watchersCompare

[ Source](https://github.com/joseluisq/guztav)[ Packagist](https://packagist.org/packages/joseluisq/guztav)[ Docs](http://guzzlephp.org/)[ RSS](/packages/joseluisq-guztav/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Guztav
======

[](#guztav)

> A small RESTful API client around [PHP Guzzle](https://github.com/guzzle/guzzle).

[![Build Status](https://camo.githubusercontent.com/6b039b1eba633032c2ee44214509b94404b5c9aa11d6c37e26066714ea3801c3/68747470733a2f2f7472617669732d63692e6f72672f6a6f73656c756973712f67757a7461762e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/joseluisq/guztav) [![Latest Stable Version](https://camo.githubusercontent.com/dd4eda59beecd79c323ca2abad363e7dda17f476d7ba597a226c1c4371fc41ef/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73656c756973712f67757a7461762f76657273696f6e)](https://packagist.org/packages/joseluisq/guztav) [![Latest Unstable Version](https://camo.githubusercontent.com/3a2c4e38087a77fb91f85aabcf7e95e5a8bf8d93c33f30c486cca714a9097baf/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73656c756973712f67757a7461762f762f756e737461626c65)](//packagist.org/packages/joseluisq/guztav) [![Total Downloads](https://camo.githubusercontent.com/d12a5e6ee0478c5723fff8ed8d460f2ea6198f2dc46e71941c18b75fc30fc4e9/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73656c756973712f67757a7461762f646f776e6c6f616473)](https://packagist.org/packages/joseluisq/guztav) [![License](https://camo.githubusercontent.com/5a660dc4e1eac050c14154d0dd8901c44a2291177775b933911c402c15272779/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73656c756973712f67757a7461762f6c6963656e7365)](https://packagist.org/packages/joseluisq/guztav)

Features
--------

[](#features)

- It's only a wrapper around [Guzzle](https://github.com/guzzle/guzzle). It means that you can use the same API like: `Client`, `Request` and `Response` objects.
- Some helper functions for more friendly `Response` data handling like : `$response->toArray()`, `$response->toString()`, etc.
- You can define your `BASE_URI` and `ACCESS_TOKEN` settings via `.env` file. For example using [Dotenv](https://github.com/vlucas/phpdotenv/) package (optional).

Install
-------

[](#install)

```
composer require joseluisq/guztav
```

Usage
-----

[](#usage)

#### Settings via .env file

[](#settings-via-env-file)

```
# Define your API settings
GUZTAV_BASE_URI='http://localhost:8001/api/v1/'
GUZTAV_ACCESS_TOKEN='eyJ0eXBiOiJKV1QiLCN0bx.....'
```

- `GUZTAV_BASE_URI` : The same Guzzle `base_uri` param for `Client` settings.
- `GUZTAV_ACCESS_TOKEN` : It will be to added to the current header like `Authorization: Bearer ...` (optional)

#### Settings via constructor

[](#settings-via-constructor)

You can also pass the same Guzzle options for `Client` object.

```
