src/Thybag/Auth/SharePointOnlineAuth.php
protected function authCurl($url, $payload, $header = false){
		$ch = curl_init();
		curl_setopt($ch,CURLOPT_URL,$url);
		curl_setopt($ch,CURLOPT_POST,1);
		curl_setopt($ch,CURLOPT_POSTFIELDS,  $payload);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	  	curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($ch, CURLOPT_TIMEOUT, 10);

		if($header)  curl_setopt($ch, CURLOPT_HEADER, true);

		$result = curl_exec($ch);

		// catch error
		if($result === false) {
			throw new \SoapFault('Sender', 'Curl error: ' . curl_error($ch));
		}

		curl_close($ch);

		return $result;
	}
protected function authCurl($url, $payload, $header = false){
		$ch = curl_init();
		curl_setopt($ch,CURLOPT_URL,$url);
		curl_setopt($ch,CURLOPT_POST,1);
		curl_setopt($ch,CURLOPT_POSTFIELDS,  $payload);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

	  	curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($ch, CURLOPT_TIMEOUT, 10);

		if($header)  curl_setopt($ch, CURLOPT_HEADER, true);

		$result = curl_exec($ch);

		// catch error
		if($result === false) {
			throw new \SoapFault('Sender', 'Curl error: ' . curl_error($ch));
		}

		curl_close($ch);

		return $result;
	}
protected function authCurl ( $ url , $ payload , $ header = false ) { $ ch = curl_init ( ) ; curl_setopt ( $ ch , CURLOPT_URL , $ url ) ; curl_setopt ( $ ch , CURLOPT_POST , 1 ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , $ payload ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ ch , CURLOPT_SSLVERSION , CURL_SSLVERSION_TLSv1 ) ; curl_setopt ( $ ch , CURLOPT_SSL_VERIFYPEER , false ) ; curl_setopt ( $ ch , CURLOPT_TIMEOUT , 10 ) ; if ( $ header ) curl_setopt ( $ ch , CURLOPT_HEADER , true ) ; $ result = curl_exec ( $ ch ) ; // catch error if ( $ result === false ) { throw new \ SoapFault ( 'Sender' , 'Curl error: ' . curl_error ( $ ch ) ) ; } curl_close ( $ ch ) ; return $ result ; }
authCurl
helper method used to cURL SharePoint Online authentiction webservices

@param $url URL to cURL
@param $payload value to post to URL
@param $header true|false - Include headers in response
@return $raw Data returned from cURL.
authCurl helper method used to cURL SharePoint Online authentiction webservices