original_string: protected function request($url, array $body = array()){
          $baseUrl = self::BASE_URL;
          if(isset($this->baseUrl)){
              $baseUrl = $this->baseUrl;
          }
          $client = new Client($baseUrl);
          $body['key'] = $this->apiKey;
          $section = explode('\\', get_called_class());
          $section = strtolower(end($section));
          $request = $client->post($section.'/'.$url.'.json', NULL, $body);
          try{
              $response = $request->send();
              $response = $response->getBody();
          }
          catch(ServerErrorResponseException $e){
              $response = json_decode($e->getResponse()->getBody(), true);
              throw new APIException($response['message'], $response['code'], $response['status'], $response['name'], $e);
          }
          return json_decode($response, true);
      }
code: protected function request($url, array $body = array()){
          $baseUrl = self::BASE_URL;
          if(isset($this->baseUrl)){
              $baseUrl = $this->baseUrl;
          }
          $client = new Client($baseUrl);
          $body['key'] = $this->apiKey;
          $section = explode('\\', get_called_class());
          $section = strtolower(end($section));
          $request = $client->post($section.'/'.$url.'.json', NULL, $body);
          try{
              $response = $request->send();
              $response = $response->getBody();
          }
          catch(ServerErrorResponseException $e){
              $response = json_decode($e->getResponse()->getBody(), true);
              throw new APIException($response['message'], $response['code'], $response['status'], $response['name'], $e);
          }
          return json_decode($response, true);
      }
code_tokens: protected function request ( $ url , array $ body = array ( ) ) { $ baseUrl = self :: BASE_URL ; if ( isset ( $ this -> baseUrl ) ) { $ baseUrl = $ this -> baseUrl ; } $ client = new Client ( $ baseUrl ) ; $ body [ 'key' ] = $ this -> apiKey ; $ section = explode ( '\\' , get_called_class ( ) ) ; $ section = strtolower ( end ( $ section ) ) ; $ request = $ client -> post ( $ section . '/' . $ url . '.json' , NULL , $ body ) ; try { $ response = $ request -> send ( ) ; $ response = $ response -> getBody ( ) ; } catch ( ServerErrorResponseException $ e ) { $ response = json_decode ( $ e -> getResponse ( ) -> getBody ( ) , true ) ; throw new APIException ( $ response [ 'message' ] , $ response [ 'code' ] , $ response [ 'status' ] , $ response [ 'name' ] , $ e ) ; } return json_decode ( $ response , true ) ; }
docstring: Send a request to Mandrill. All requests are sent via HTTP POST.
  @param string $url
  @param array $body
  @throws Exception\APIException
  @return array
docstring_tokens: Send a request to Mandrill . All requests are sent via HTTP POST .