Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gawsoftpl/rest-api-client-framework-php
https://github.com/gawsoftpl/rest-api-client-framework-php
Last synced: 9 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gawsoftpl/rest-api-client-framework-php
- Owner: gawsoftpl
- License: mit
- Created: 2022-02-10T09:55:13.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-05T18:50:50.000Z (over 1 year ago)
- Last Synced: 2024-04-23T22:09:41.071Z (9 months ago)
- Language: PHP
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About
Rest client framework for your api client for PHP. In below example how to use this simple scriptWrite quick your api client
# Example```php
api_key = $api_key;
$this->endpoint = getenv('WEBSHOTAPI_ENV') == 'dev' ? 'http://localhost:3000' : 'https://api.webshotapi.com/v1';
}/**
* Download info about your account
*
* @return Response
* @throws ClientException
*/
function info(): Response{
$base = new Base($this);
return $base->method([
'path' => '/info',
'method' => 'GET'
]);
}/**
* Set connection timeout in seconds
*
* @param $timeout
*/
function setTimeout(int $timeout){
$this->timeout = $timeout;
}function getApiKey(): string{
return $this->api_key;
}function getTimeout(): int{
return $this->timeout;
}/**
* Set api endpoint. This method can use for test or if you want to change version of REST api
* @param $endpoint
*/
function setEndpoint(string $endpoint){
$this->endpoint = $endpoint;
}function getEndpoint(): string{
return $this->endpoint;
}function projects(): Project{
return new Project($this);
}function projectsUrl(): ProjectUrl{
return new ProjectUrl($this);
}}
```