Exemple #1
0
 function _prepData()
 {
     $post = parent::_prepData();
     $post += "&url=" . $this->url;
     $post += "&encryption=" . $this->encryption;
     $post += "&port=" . $this->port;
     if ($this->auth != null) {
         $post += "&auth=" . $this->auth;
     }
     if ($this->shouldContain != null) {
         $post += "&shouldcontain=" . $this->shouldContain;
     }
     if ($this->shouldNotContain != null) {
         $post += "&shouldnotcontain=" . $this->shouldNotContain;
     }
     //if ($this->postData != null) $post += "&postdata=" . $this->postData;  //TODO: Find out how this should actually be formatted, how do you POST POST data?
     if (!empty($this->requestHeaders)) {
         $i = 0;
         foreach ($this->requestHeaders as $header) {
             $i++;
             $post = +"&requestheadername" . $i . "=" . $header;
         }
     }
     return $post;
 }
Exemple #2
0
 /**
  * Internal function to handle adding all types of check, assumes other functions
  * have validated the data
  *
  * @param Pingdom_Check $check Check object to insert
  * @return string JSON string of result
  */
 public function addCheck($check)
 {
     $url = "/checks";
     $postData = $check->_prepData();
     return $this->_doRequest($url, $postData, self::METHOD_POST);
 }