예제 #1
0
 /**
  * @param string $url
  * @param array|string $postData
  * @param array $headers
  */
 public function __construct($url, $postData = null, array $headers = array())
 {
     if ($postData = $postData !== null ? json_encode($postData, JSON_PRETTY_PRINT) : null) {
         $postData = Stream::factory($postData);
     }
     parent::__construct('PUT', $url, $headers, $postData);
     $this->setHeader('Content-type', 'application/json');
 }
 /**
  * @param string $url
  * @param array $params
  */
 public function __construct($url, array $params = array())
 {
     parent::__construct('DELETE', $params);
 }
예제 #3
0
 /**
  * @param string $url
  * @param array $params
  */
 public function __construct($url, array $params = array())
 {
     parent::__construct('GET', $url, $params);
     $this->setHeader('Content-type', 'application/json');
 }