initRequest() protected method

Initializes a new session and return a cURL handle.
protected initRequest ( string $url, array $options = [] ) : cURL
$url string url to request.
$options array HTTP request options. Keys: query, data, referer.
return cURL handle.
Exemplo n.º 1
0
 /**
  * Initializes a new session and return a cURL handle.
  * @param string $url url to request.
  * @param array $options HTTP request options. Keys: query, data, referer.
  * @param boolean $parseJson Whether to parse response in json format.
  * @return cURL handle.
  */
 protected function initRequest($url, $options = array())
 {
     $ch = parent::initRequest($url, $options);
     curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
     if (isset($params['data'])) {
         curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml", "SOAPAction: \"/soap/action/query\"", "Content-length: " . strlen($data)));
     }
     return $ch;
 }
Exemplo n.º 2
0
 /**
  * Initializes a new session and return a cURL handle.
  *
  * @param string $url url to request.
  * @param array $options HTTP request options. Keys: query, data, referer.
  * @param boolean $parseJson Whether to parse response in json format.
  * @return cURL handle.
  */
 protected function initRequest($url, $options = array())
 {
     $ch = parent::initRequest($url, $options);
     curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
     return $ch;
 }