turkevich / php-restful-client
PHP RESTful Client
Installs: 67
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/turkevich/php-restful-client
Requires
- php: >=5.3.0
Requires (Dev)
This package is not auto-updated.
Last update: 2025-10-11 23:27:36 UTC
README
Installation
Installation with Composer
Either run
php composer.phar require --prefer-dist turkevich/rest-client:"dev-master"
or add in composer.json
"require": {
...
"turkevich/php-restful-client":"dev-master"
}
Well done!
Example call GET
$result = (new Client())->requestParams(Client::GET, $url, $data)->call();
Example call CUSTOM with GET data
$result = (new Client())->requestParams(Client::CUSTOM, $url, $data)->call();
Example call CUSTOM with POST data
$result = (new Client())->requestParams(Client::CUSTOM, $url, $data)->usePost()->call();
Example call to url with http auth
$result = (new Client())->requestParams(Client::POST, $url, $data)->useHttpAuth($username, $password)->call();
Use response content type
$result = (new Client())->requestParams(Client::PATCH, $url, $data)->useResponseContentType()->call();
Get result in stdClass
$result = (new Client())->requestParams(Client::PUT, $url, $data)->usePost()->call(true);
Enjoy, guys!