kfosoft/php-restful-client

There is no license information available for the latest version (1.0) of this package.

PHP RESTful Client

Installs: 362

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/kfosoft/php-restful-client

1.0 2015-09-25 20:40 UTC

This package is not auto-updated.

Last update: 2025-10-12 00:20:26 UTC


README

Installation

Installation with Composer

Either run

    php composer.phar require --prefer-dist kfosoft/rest-client:"*"

or add in composer.json

    "require": {
            ...
            "kfosoft/php-restful-client":"*"
    }

Well done!

Example call GET

    $result = (new RestClient())->requestParams(RestClient::GET, $url, $data)->call();

Example call CUSTOM with GET data

    $result = (new RestClient())->requestParams(RestClient::CUSTOM, $url, $data)->call();

Example call CUSTOM with POST data

    $result = (new RestClient())->requestParams(RestClient::CUSTOM, $url, $data)->usePost()->call();

Example call to url with http auth

    $result = (new RestClient())->requestParams(RestClient::POST, $url, $data)->useHttpAuth($username, $password)->call();

Use response content type

    $result = (new RestClient())->requestParams(RestClient::PATCH, $url, $data)->useResponseContentType()->call();

Get result in stdClass

    $result = (new RestClient())->requestParams(RestClient::PUT, $url, $data)->usePost()->call(true);

Enjoy, guys!