You are here

function _chr_curl_set_options in cURL HTTP Request 7

Same name and namespace in other branches
  1. 6 chr.module \_chr_curl_set_options()

Set cURL options.

Parameters

array $options [reference]: Options array

object $ch [reference]: cURL Object

1 call to _chr_curl_set_options()
chr_curl_http_request in ./chr.module
Performs an HTTP request.

File

./chr.module, line 318
cURL HTTP Request methods

Code

function _chr_curl_set_options(&$options, &$ch) {

  // Set any extra cURL options
  foreach ($options['curl_opts'] as $opt => $value) {
    $set = curl_setopt($ch, $opt, $value);
    if (FALSE === $set) {
      watchdog('curl_http_request', 'Unable to set cURL option @opt : @value', array(
        '@opt' => $opt,
        '@value' => $value,
      ), WATCHDOG_ERROR);
    }
  }
}