protected function makeRequest(callable $callback = null)
    {
        // Foreach request:
        foreach ($this->requests as $key => $request) {
            $data = (isset($this->data[$key]) and $this->data[$key] !== null) ? $this->data[$key] : null;

            // Follow any 3xx HTTP status code.
            $request->setOption(CURLOPT_FOLLOWLOCATION, true);

            switch ($this->verb) {
                case 'DELETE':
                    $this->prepareDeleteRequest($request);
                    break;
                case 'GET':
                    $this->prepareGetRequest($request);
                    break;
                case 'POST':
                    $this->preparePostRequest($request, $data);
                    break;
                case 'PUT':
                    $this->preparePutRequest($request, $data);
                    break;
            }

            // Add the request to the dispatcher.
            $this->dispatcher->add($request);
        }

        // Execute the request(s).
        if ($callback !== null) {
            $this->dispatcher->execute($callback);
        } else {
            $this->dispatcher->execute();
        }
    }
protected function makeRequest(callable $callback = null)
    {
        // Foreach request:
        foreach ($this->requests as $key => $request) {
            $data = (isset($this->data[$key]) and $this->data[$key] !== null) ? $this->data[$key] : null;

            // Follow any 3xx HTTP status code.
            $request->setOption(CURLOPT_FOLLOWLOCATION, true);

            switch ($this->verb) {
                case 'DELETE':
                    $this->prepareDeleteRequest($request);
                    break;
                case 'GET':
                    $this->prepareGetRequest($request);
                    break;
                case 'POST':
                    $this->preparePostRequest($request, $data);
                    break;
                case 'PUT':
                    $this->preparePutRequest($request, $data);
                    break;
            }

            // Add the request to the dispatcher.
            $this->dispatcher->add($request);
        }

        // Execute the request(s).
        if ($callback !== null) {
            $this->dispatcher->execute($callback);
        } else {
            $this->dispatcher->execute();
        }
    }
protected function makeRequest ( callable $ callback = null ) { // Foreach request: foreach ( $ this -> requests as $ key => $ request ) { $ data = ( isset ( $ this -> data [ $ key ] ) and $ this -> data [ $ key ] !== null ) ? $ this -> data [ $ key ] : null ; // Follow any 3xx HTTP status code. $ request -> setOption ( CURLOPT_FOLLOWLOCATION , true ) ; switch ( $ this -> verb ) { case 'DELETE' : $ this -> prepareDeleteRequest ( $ request ) ; break ; case 'GET' : $ this -> prepareGetRequest ( $ request ) ; break ; case 'POST' : $ this -> preparePostRequest ( $ request , $ data ) ; break ; case 'PUT' : $ this -> preparePutRequest ( $ request , $ data ) ; break ; } // Add the request to the dispatcher. $ this -> dispatcher -> add ( $ request ) ; } // Execute the request(s). if ( $ callback !== null ) { $ this -> dispatcher -> execute ( $ callback ) ; } else { $ this -> dispatcher -> execute ( ) ; } }
Prepares and sends HTTP requests.

@param callable $callback
Prepares and sends HTTP requests .