Skip to content
This repository has been archived by the owner on Oct 24, 2020. It is now read-only.

Curl Options

Owen Voke edited this page Nov 12, 2017 · 3 revisions

Curl is used as our transportation engine for sending Rest API calls. You can configure Curl options as follows:

Configurations

  • http.<CURL_HEADER>
    • Replace CURL_HEADER with curl constants.
    • e.g. http.CURLOPT_CONNECTTIMEOUT = 30

As you can see, any curl constant that needs to be added, needs to be prefixed with http..

By default, there are many configurations set by default. By defining any configuration here would override the default.

Samples

Using sdk_config.ini

;Connection Information
[Http]
; Add Curl Constants to be configured
; The settings provided in configurations would override defaults
; if provided in configurations
http.CURLOPT_CONNECTTIMEOUT = 30

Using config array

$config = array(
    'mode' => 'sandbox',
    'log.LogEnabled' => true,
    'log.FileName' => '../BlockCypher.log',
    'log.LogLevel' => 'DEBUG', // PLEASE USE `INFO` LEVEL FOR LOGGING IN LIVE ENVIRONMENTS
    'validation.level' => 'log',
    'http.CURLOPT_CONNECTTIMEOUT' => 30
);