{"id":15023230,"url":"https://github.com/mikecbrant/php-rest-client","last_synced_at":"2025-10-30T06:45:25.908Z","repository":{"id":4233140,"uuid":"5356569","full_name":"mikecbrant/php-rest-client","owner":"mikecbrant","description":"A PHP cURL REST client class with has multi_exec support","archived":false,"fork":false,"pushed_at":"2017-06-08T00:11:58.000Z","size":97,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T00:01:51.458Z","etag":null,"topics":["curl","curl-library","curl-multi","php","php5","php7","phpunit","rest","rest-client"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikecbrant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-09T14:26:46.000Z","updated_at":"2022-11-08T13:06:19.000Z","dependencies_parsed_at":"2022-09-05T18:12:00.209Z","dependency_job_id":null,"html_url":"https://github.com/mikecbrant/php-rest-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikecbrant%2Fphp-rest-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikecbrant%2Fphp-rest-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikecbrant%2Fphp-rest-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikecbrant%2Fphp-rest-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikecbrant","download_url":"https://codeload.github.com/mikecbrant/php-rest-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103915,"owners_count":21048244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["curl","curl-library","curl-multi","php","php5","php7","phpunit","rest","rest-client"],"created_at":"2024-09-24T19:58:51.357Z","updated_at":"2025-10-30T06:45:25.799Z","avatar_url":"https://github.com/mikecbrant.png","language":"PHP","readme":"[![Build Status](https://travis-ci.org/mikecbrant/php-rest-client.svg?branch=master)](https://travis-ci.org/mikecbrant/php-rest-client)\n[![Code Climate](https://codeclimate.com/github/mikecbrant/php-rest-client/badges/gpa.svg)](https://codeclimate.com/github/mikecbrant/php-rest-client)\n[![Test Coverage](https://codeclimate.com/github/mikecbrant/php-rest-client/badges/coverage.svg)](https://codeclimate.com/github/mikecbrant/php-rest-client/coverage)\n\n# php-rest-client\n\nThis library provides classes implementing basic REST clients based on PHP's cURL extension.  Two client classes are made available:\n\n- [RestClient](docs/MikeBrant-RestClientLib-RestClient.md) - a class for executing RESTful service calls.\n- [RestMultiClient](docs/MikeBrant-RestClientLib-RestMultiClient.md) - a class which extends RestClient to provide \ncurl_multi capabilities to allow multiple RESTful calls to be made in parallel.\n\nAdditionally, this library provides classes which wrap curl responses within object oriented interface:\n- [CurlHttpResponse](docs/MikeBrant-RestClientLib-CurlHttpResponse.md) - a class which encapsulates an HTTP response \nreceived via cURL into a class wrapper.\n- [CurlMultiHttpResponse](docs/MikeBrant-RestClientLib-CurlMultiHttpResponse.md) - a class which represents a collection of \nCurlHttpRepsonse objects as returned from multiple parallel cURL calls.\n\nThese classes support:\n- HTTP actions - GET, POST, PUT, DELETE, and HEAD\n- Basic authentication\n- SSL, with the ability to toggle SSL certificate validation to help in development/test enviroments\n\nRequires:\n- PHP 5.6+\n- PHP cURL extension\n- PHPUnit 5.7+ (for unit tests only)\n\nThis library is developed against PHP 7.1 and tested via Travis CI against:\n- PHP 5.6.*\n- PHP 7.0.*\n- PHP 7.1.*\n- PHP Nightly build\n\n[Full library documentation](/docs/RestClientLib.md)\n\n[Travis CI build status](https://travis-ci.org/mikecbrant/php-rest-client)\n\n[Code Climate code coverage and health information](https://codeclimate.com/github/mikecbrant/php-rest-client)\n\n[Packagist page](https://packagist.org/packages/mikecbrant/php-rest-client)\n\n\n\n**Usage example:**\n\n```\n\u003c?php\n\nuse MikeBrant\\RestClientLib;\n\n/**\n * Single request using RestClient\n */\n$restClient = new RestClient();\n$restClient-\u003esetRemoteHost('foo.bar.com')\n           -\u003esetUriBase('/some_service/')\n           -\u003esetUseSsl(true)\n           -\u003esetUseSslTestMode(false)\n           -\u003esetBasicAuthCredentials('username', 'password')\n           -\u003esetHeaders(array('Accept' =\u003e 'application/json'));\n// make requests against service\n$response = $restClient-\u003eget('resource');\n$response = $restClient-\u003epost('resource', $data);\n$response = $restClient-\u003eput('resource', $data);\n$response = $restClient-\u003edelete('resource');\n$response = $restClient-\u003ehead('resource');\n\n/**\n * Multiple parallel requests using RestMultiClient\n */\n$restMultiClient = new RestMultiClient();\n$restMultiClient-\u003esetRemoteHost('foo.bar.com')\n                -\u003esetUriBase('/some_service/')\n                -\u003esetUseSsl(true)\n                -\u003esetUseSslTestMode(false)\n                -\u003esetBasicAuthCredentials('username', 'password')\n                -\u003esetHeaders(array('Accept' =\u003e 'application/json'));\n// make requests against service\n$responses = $restMultiClient-\u003eget(['resource1', 'resource2', ...]);\n$responses = $restMultiClient-\u003epost(['resource1', 'resource2', ...], [$data1, $data2, ...]);\n$responses = $restMultiClient-\u003eput(['resource1', 'resource2', ...], [$data1, $data2, ...]);\n$responses = $restMultiClient-\u003edelete(['resource1', 'resource2', ...]);\n$responses = $restMultiClient-\u003ehead(['resource1', 'resource2', ...]);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikecbrant%2Fphp-rest-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikecbrant%2Fphp-rest-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikecbrant%2Fphp-rest-client/lists"}