BunnyCDN-API icon indicating copy to clipboard operation
BunnyCDN-API copied to clipboard

Return response for all valid http status codes

Open careybaird opened this issue 3 years ago • 0 comments

Currently, only 200 status code returns the response.

I suggest returning the response for 2XX status codes (e.g. 201 which means resources created). Also I suggest returning the response for errors i.e.

BunnyAPI.php:100

if ($responseCode >= 200 && $responseCode < 300) {
            return $this->data = json_decode($result, true);
        } else {
            return [
                'http_code' => $responseCode,
                'response' => json_decode($result, true),
            ];
        }

careybaird avatar Nov 12 '22 13:11 careybaird