The Curler component of the Salient toolkit
salient/curler provides an HTTP client optimised for RESTful API endpoints.
- Simple, fluent interface for sending
HEAD,GET,POST,PUT,PATCHandDELETErequests - Flexible query string and payload handling
- Uses generators to iterate over data from endpoints that use pagination
- Optional response cache for
HEAD,GETand repeatablePOSTrequests - Optional cookie handling and persistence
- Uses PSR-7 request, response and stream interfaces
- Implements PSR-18 (HTTP Client)
- Behaviour can be customised via stackable middleware
- Generates HTTP Archive (HAR) files for debugging and analysis
<?php
$curler = new \Salient\Curler\Curler('https://api.github.com/repos/salient-labs/toolkit/releases/latest');
echo 'Latest release: ' . $curler->get()['tag_name'] . \PHP_EOL;API documentation for salient/curler tracks the main branch of
the toolkit's GitHub repository, where further documentation can also
be found.