Esempio n. 1
0
 /** @return CUrl */
 private function createCurl($url, array $post, $filename)
 {
     $request = new Curl\Request($url);
     $request->setPost($post, array('file' => $filename));
     $curl = new Curl\CurlSender();
     $curl->setTimeout(30);
     $curl->options = array('verbose' => 0, 'ssl_verifypeer' => 0, 'ssl_verifyhost' => 2) + $curl->options;
     $request->setSender($curl);
     return $request;
 }
Esempio n. 2
0
 /**
  * Creates a new Notification of a specific type.
  * 
  * @param NotificationRequest $notificationRequest
  * @return NotificationObject
  */
 public function addNotificationObject(NotificationRequest $notificationRequest)
 {
     $request = new Request(Chain::URL . '/notifications');
     $request->setPost(Json::encode($notificationRequest->getParameters()));
     return NotificationObject::createFromArray($this->sendRequest($request));
 }