function _chr_curl_set_headers in cURL HTTP Request 6
Same name and namespace in other branches
- 7 chr.module \_chr_curl_set_headers()
Set default headers in curl object
Parameters
array $options [reference]: Options array
object $ch [reference]: cURL Object
1 call to _chr_curl_set_headers()
- chr_curl_http_request in ./
chr.module - Performs an HTTP request.
File
- ./
chr.module, line 383
Code
function _chr_curl_set_headers(&$options, &$ch) {
if (is_array($options['headers']) and !empty($options['headers'])) {
$headers = array();
foreach ($options['headers'] as $key => $value) {
$headers[] = trim($key) . ": " . trim($value);
}
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}
}