Permalink
Browse files

ENHANCEMENT you can now pass arbitrary CURL options to the request() …

…method of RestfulService. (from r98656)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102770 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
chillu committed Apr 14, 2010
1 parent 55c4c90 commit f660634cc9b33b964ed30d882213cbb255818e51
Showing with 4 additions and 1 deletion.
  1. +4 −1 api/RestfulService.php
View
@@ -101,7 +101,7 @@ protected function constructURL(){
*
* This is a replacement of {@link connect()}.
*/
- public function request($subURL = '', $method = "GET", $data = null, $headers = null) {
+ public function request($subURL = '', $method = "GET", $data = null, $headers = null, $curlOptions = array()) {
$url = $this->baseURL . $subURL; // Url for the request
if($this->queryString) {
if(strpos($url, '?') !== false) {
@@ -155,6 +155,9 @@ public function request($subURL = '', $method = "GET", $data = null, $headers =
if(is_array($this->proxy)) {
curl_setopt_array($ch, $this->proxy);
}
+
+ // Set any custom options passed to the request() function
+ curl_setopt_array($ch, $curlOptions);
// Run request
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

0 comments on commit f660634

Please sign in to comment.