-
Notifications
You must be signed in to change notification settings - Fork 3
cURL
Miky edited this page Sep 10, 2015
·
2 revisions
The DonDominio API Client features a cURL Wrapper to communicate with the DonDominio API using POST requests.
You can use this Wrapper to perform direct calls to the API. However, we encourage you to use the DonDominio API Client object, which is easier to use and automatically performs many tasks.
Instantiate a new DonDominioClientPostCurl object to use the cURL Wrapper. The constructor takes an array of options.
For example, to instantiate a cURL Client with debug enabled:
$curlWrapper = new DonDominioClientPostCurl(array(
'debug' => true
));The cURL client accepts an array with the following options:
| Option | Type | Required? | Default | Description |
|---|---|---|---|---|
| endpoint | string | No | URL where the DonDominio API is located | |
| port | integer | No | 443 | Port to use when connecting to the API |
| timeout | integer | No | 15 | Connection timeout |
| debug | boolean | No | false | Enable or disable debug logging |
| debugOutput | string | No | NULL | Target of the log information You can provide a filename to store the log, or set this to NULL to log to stdout. Setting it to error_log will use PHP's built-in error logging system. |
| verifySSL | boolean | No | false | Verify the SSL certificate from the server |
| format | string | No | json | Output format json: JSON string xml: XML string |
| pretty | boolean | No | false | Preformat the output information |
Performs an API call using the cURL client.
Check the API documentation to learn more about the available API calls.
string execute ( string $url [, array $args = [] )| Parameter | Type | Required? | Default | Description |
|---|---|---|---|---|
| url | string | Yes | API URL | |
| args | array | No | array() | Arguments to be passed to the API call |
String containing the response from the API.