mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT you can now pass arbitrary CURL options to the request() method of RestfulService.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98656 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
0cffea71e9
commit
f685cf956d
@ -109,7 +109,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) {
|
||||
@ -163,6 +163,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);
|
||||
|
Loading…
Reference in New Issue
Block a user