Example #1
0
 /**
  * {@inheritDoc}
  */
 public function execute($httpMethod, $url, array $parameters = [])
 {
     try {
         $parameters = Utility::prepareParameters($parameters);
         $response = $this->getClient()->{$httpMethod}('v1/' . $url, ['query' => $parameters]);
         return json_decode((string) $response->getBody(), true);
     } catch (\Exception $e) {
         new Handler($e);
     }
 }
Example #2
0
 /**
  * {@inheritDoc}
  */
 public function execute($httpMethod, $url, array $parameters = [], array $body = [])
 {
     $parameters = Utility::prepareParameters($parameters);
     return $this->getClient()->{$httpMethod}("v1/{$url}", ['query' => $parameters, 'body' => $body]);
 }