Merge branch 'master' of git://github.com/pjdietz/WellRESTed

Conflicts:
	src/pjdietz/WellRESTed/Message.php
This commit is contained in:
PJ Dietz 2013-01-28 22:24:54 -05:00
commit 4285636088
2 changed files with 17 additions and 0 deletions

View File

@ -148,6 +148,20 @@ abstract class Message
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.
*

View File

@ -265,6 +265,9 @@ class Request extends Message
}
// Add headers.
curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headerLines);
// Make the cURL request.
$result = curl_exec($ch);