src/Pushman.php
private function processRequest($url, $headers, $method = 'post')
    {
        if (array_key_exists('body', $headers)) {
            $headers['body'] = json_encode($headers['body']);
        }

        if ($method == 'post') {
            $response = $this->guzzle->request('POST', $url, $headers);
        } elseif ($method == 'delete') {
            $response = $this->guzzle->request('DELETE', $url, $headers);
        } else {
            $params = $this->processGetParams($headers);
            $response = $this->guzzle->request('GET', $url . $params);
        }
        $response = $this->processResponse($response);

        return $response;
    }
private function processRequest($url, $headers, $method = 'post')
    {
        if (array_key_exists('body', $headers)) {
            $headers['body'] = json_encode($headers['body']);
        }

        if ($method == 'post') {
            $response = $this->guzzle->request('POST', $url, $headers);
        } elseif ($method == 'delete') {
            $response = $this->guzzle->request('DELETE', $url, $headers);
        } else {
            $params = $this->processGetParams($headers);
            $response = $this->guzzle->request('GET', $url . $params);
        }
        $response = $this->processResponse($response);

        return $response;
    }
private function processRequest ( $ url , $ headers , $ method = 'post' ) { if ( array_key_exists ( 'body' , $ headers ) ) { $ headers [ 'body' ] = json_encode ( $ headers [ 'body' ] ) ; } if ( $ method == 'post' ) { $ response = $ this -> guzzle -> request ( 'POST' , $ url , $ headers ) ; } elseif ( $ method == 'delete' ) { $ response = $ this -> guzzle -> request ( 'DELETE' , $ url , $ headers ) ; } else { $ params = $ this -> processGetParams ( $ headers ) ; $ response = $ this -> guzzle -> request ( 'GET' , $ url . $ params ) ; } $ response = $ this -> processResponse ( $ response ) ; return $ response ; }
Process a request and return the handled response.

@param string $url
@param array  $headers
@param string $method
@return string
Process a request and return the handled response .