bshaffer / php-echonest-api

PHP classes for the Echo Nest API
MIT License
98 stars 41 forks source link

Use output buffering in "curl"-lib of your code #8

Open eerrap opened 13 years ago

eerrap commented 13 years ago

Use output buffering in "protected function doCurlCall" in file curl.php to prevent instant output which is not necessary because of return values available! If this is changed, a developer can decide whether to output the row response from echonest or to process it any further.

eerrap commented 13 years ago

May be better not change "curl.php" but change "HttpClient.php" to have the following lines in "request" method:

        ob_start();
        $this->doRequest($url, $parameters, $httpMethod, $options);
        $response = ob_get_contents();
        ob_end_clean();
bshaffer commented 13 years ago

I've added the raw option on all API objects (see the bottom of the README for more info). Will this accomplish what you're looking for here?