Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drunomics/xtrf-rest-client
XTRF REST client library based on Guzzle.
https://github.com/drunomics/xtrf-rest-client
Last synced: about 1 month ago
JSON representation
XTRF REST client library based on Guzzle.
- Host: GitHub
- URL: https://github.com/drunomics/xtrf-rest-client
- Owner: drunomics
- License: gpl-2.0
- Created: 2016-11-24T15:57:29.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-26T08:11:58.000Z (over 2 years ago)
- Last Synced: 2024-11-14T00:46:41.641Z (about 2 months ago)
- Language: PHP
- Size: 39.1 KB
- Stars: 0
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# XTRF REST client library
REST client library based on Guzzle.The client provides a nice API using model classes for the data structure. The models are generated based upon the Swagger REST service specification. See http://swagger.io/.
The specification (swagger.json) can be edited using Swagger's online editor: http://editor.swagger.io
Usage
-----```
$config = [
'base_uri' => 'http://example.com',
'username' => 'test',
'password' => 'test',
];
$client = \drunomics\XtrfClient\XtrfClient::create($config);
$quote = $client->getQuote($quote_id);
//...
// More examples like quote creation can be found at the tests, see https://github.com/drunomics/xtrf-rest-client/blob/master/tests/XtrfApiIntegrationTest.php#L145.
```Notes on using swagger-UI:
--------------------------
see https://github.com/swagger-api/swagger-uiSwagger-ui can be used to provide a good overview and curl commands for testing. The following instructions describe how to run swagger-ui easily:
- Run swagger-ui via "composer swagger-ui" command.
- Start with the authentication call. It's result needs to be copied into the
api-key field at the top.- The cookie authentication does not work from swagger. But the generated curl
commands do. If you have troubles with SSL verification you can prepend the
curl options:curl -3 --insecure OTHER OPTIONS
Generate models based upon swagger spec
----------------------------------------- Run `composer install` in the libraries directory
- Run `composer generate` - that's it.