Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vectorface/api-client-php
https://github.com/vectorface/api-client-php
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/vectorface/api-client-php
- Owner: Vectorface
- License: mit
- Created: 2013-09-29T20:07:11.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-04-08T20:03:34.000Z (almost 6 years ago)
- Last Synced: 2024-11-05T10:38:47.383Z (3 months ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 2
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
API-client-php
==============A very simple/naive JSON/REST API client on top of cURL.
## Prerequisites
* Must have username, password and url for the REST API
* Must be running PHP >= 7.0## Example
```PHP
'example',
'password' => '3x4mpl3',
'url' => 'http://domain.tld'
]);/*
* This will:
* - Make a request to
* http://domain.tld/users?filters=fname:Jon&fields=user_id,fname,lname
* - JSON-decode the response
* - return the result
*/
$response = $api->request('/users', [
'filters' => 'fname:Jon',
'fields' => 'user_id,fname,lname'
]);// $response should contain a decoded JSON response from the API
```