src/Http/Client.php
public function request($path, array $parameters = array(), $httpMethod = 'GET', array $headers = array())
    {
        $client = $this->getHttpClient();
        $client->reset();
        
        $client->setUri($this->options['base_url'] . $this->options['api_version'] . '/' . $path);
        $request = $client->getRequest();

        if ($httpMethod == 'GET') {
            $query = $request->getQuery();

            foreach ($parameters as $key => $value) {
                $query->set($key, $value);
            }
        } elseif ($httpMethod == 'POST') {
            $client->setEncType('multipart/form-data');
            $request->setMethod('POST');
            $post = $request->getPost();

            foreach ($parameters as $key => $value) {
                $post->set($key, $value);
            }
        }
        
        //Trigger Pre Send Event to modify Request Object
        $this->getEventManager()->trigger('pre.send', $request);

        $response = $client->dispatch($request);

        //Trigger Post Send to Modify/Validate Response object
        $result = $this->getEventManager()->trigger('post.send', $response);
        if ($result->stopped()) {
            $response = $result->last();
        }

        $this->request = $request;

        $result = json_decode($response->getBody());
        
        return $response;
    }
public function request($path, array $parameters = array(), $httpMethod = 'GET', array $headers = array())
    {
        $client = $this->getHttpClient();
        $client->reset();
        
        $client->setUri($this->options['base_url'] . $this->options['api_version'] . '/' . $path);
        $request = $client->getRequest();

        if ($httpMethod == 'GET') {
            $query = $request->getQuery();

            foreach ($parameters as $key => $value) {
                $query->set($key, $value);
            }
        } elseif ($httpMethod == 'POST') {
            $client->setEncType('multipart/form-data');
            $request->setMethod('POST');
            $post = $request->getPost();

            foreach ($parameters as $key => $value) {
                $post->set($key, $value);
            }
        }
        
        //Trigger Pre Send Event to modify Request Object
        $this->getEventManager()->trigger('pre.send', $request);

        $response = $client->dispatch($request);

        //Trigger Post Send to Modify/Validate Response object
        $result = $this->getEventManager()->trigger('post.send', $response);
        if ($result->stopped()) {
            $response = $result->last();
        }

        $this->request = $request;

        $result = json_decode($response->getBody());
        
        return $response;
    }
Send Request

@param  string $path
@param  array  $parameters
@param  string $httpMethod
@param  array  $headers
@return Zend\Http\Response