Example #1
0
 /**
  * @param string $uri
  * @param array $query
  * @param array $headers
  * @param array $options
  * @return \Garden\Http\HttpResponse
  */
 public function get($uri, array $query = [], array $headers = [], $options = [])
 {
     foreach ($query as $name => $value) {
         if ($value === null) {
             unset($query[$name]);
         }
     }
     return parent::get($uri, $query, $headers, $options);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function request($method, $uri, $body, $headers = [], array $options = [])
 {
     $this->log->begin("{$method} {$uri}");
     try {
         $response = parent::request($method, $uri, $body, $headers, $options);
     } catch (\Exception $ex) {
         $this->log->endError($ex->getCode());
         throw $ex;
     }
     $this->log->endHttpStatus($response->getStatusCode());
     return $response;
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function delete($uri, array $query = [], array $headers = [], $options = [])
 {
     if ($this->auth instanceof Auth\AuthContainer) {
         $headers['Authorization'] = $this->auth->getAuth();
     }
     return parent::delete($uri, $query, $headers, $options);
 }