Merge branch 'master' of git://github.com/pjdietz/WellRESTed
Conflicts: src/pjdietz/WellRESTed/Message.php
This commit is contained in:
commit
4285636088
|
|
@ -148,6 +148,20 @@ abstract class Message
|
||||||
return $this->headers;
|
return $this->headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return an array containing one string for each header as "field: value"
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getHeaderLines()
|
||||||
|
{
|
||||||
|
$lines = array();
|
||||||
|
foreach ($this->headers as $field => $value) {
|
||||||
|
$lines[] = sprintf('%s: %s', $field, $value);
|
||||||
|
}
|
||||||
|
return $lines;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the value of a given header, or false if it does not exist.
|
* Return the value of a given header, or false if it does not exist.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -265,6 +265,9 @@ class Request extends Message
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add headers.
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headerLines);
|
||||||
|
|
||||||
// Make the cURL request.
|
// Make the cURL request.
|
||||||
$result = curl_exec($ch);
|
$result = curl_exec($ch);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue