Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit f660634cc9b33b964ed30d882213cbb255818e51 1 parent 55c4c90
@chillu chillu authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 api/RestfulService.php
View
5 api/RestfulService.php
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.