Download the PHP package pramod/php-api-consumer without Composer
On this page you can find all versions of the php package pramod/php-api-consumer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pramod/php-api-consumer
More information about pramod/php-api-consumer
Files in pramod/php-api-consumer
Package php-api-consumer
Short Description Php Api Consumer to consume external Url
License MIT
Informations about the package php-api-consumer
Api Consumer
This Package developed to request various external api without creating external service or traits.
Installation
You can install the package via composer:
Usage
Please Refer Test Case For Complete Reference which is located in tests/ExampleTest.php
Basic Syntax
Call Your Graphql Api (Next Release)
-
Add Your Service setting on <<config/api-consumer.php>>
- Add your endpoint on your request class
- In case of graphQl key inside with auto set Accept and Content-Type headers as application/json
- Method is set as POST
- Need to pass your graphql query in query key
- Default It call toJson()
List of all public graphql Api to test
Descriptions
-
consume
Request Or find Service Name mapped in config file having basic application url,version definitions. It has two payload.
consume($apiHostname, $hosturl)
Default Hosturl will be .wlink.com.np
-
via
This method is used to point service end or function name written in service Namespace
- Available Method
- first parameter: Api endpoint or uri
- Second parameter: if second param is true, first param must be method name defined inside your services Folder's class
- Available Method
-
with
Includes all parameter including headers, payload, query string and method name
- conversion method [By Default it call toJson() method]
- toArray
- toJson
- toCollection
- ssl method
- either true or false, By default its True
- timeout method
- you can pass second value, By Default its 30 seconds
- retry method
- Pass Int value to retry external api, By Default it doesnt retry.
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Pramod Katuwal
- All Contributors
License
The MIT License (MIT). Please see License File for more information.