From f660634cc9b33b964ed30d882213cbb255818e51 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 14 Apr 2010 02:20:57 +0000 Subject: [PATCH] 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 --- api/RestfulService.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/RestfulService.php b/api/RestfulService.php index 06df5ddca..4419857b9 100644 --- a/api/RestfulService.php +++ b/api/RestfulService.php @@ -101,7 +101,7 @@ class RestfulService extends ViewableData { * * 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 @@ class RestfulService extends ViewableData { 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);