The Transport is an implementation of TransportInterface, it manages the API Autentication,
returns deserialized data, and manage HTTP errors with ApiException and childs (see src/Exceptions).
Several implementations already exist (see the folder) :
Cristal\ApiWrapper\Transports\TransportGeneric JSON API without authenticationCristal\ApiWrapper\Transports\BearerExtends ofTransportsupports bearers tokensCristal\ApiWrapper\Transports\BasicExtends ofTransportsupports basic authCristal\ApiWrapper\Transports\OAuth2Extends ofTransportsupports OAuth2 (see doc)
You are likely to have to manage complex authentication, in this case your can create you own implementation of TransportInterface.
See more about the TransportInterface here.
<?php
use Cristal\ApiWrapper\Transports\Basic;
use Curl\Curl;
$transport = new Basic('username', 'password', 'http://api.example.com/v1/', new Curl);
$users = $transport->request('/users');Now that you've got transport, you're ready to implement your Wrapper.