ovh / php-ovh

Lightweight PHP wrapper for OVH APIs. That's the easiest way to use OVH.com APIs in your PHP applications.
Other
288 stars 105 forks source link

fix(Api.php) : handle 204 no content response in decodeResponse #141

Closed OctaYann closed 11 months ago

OctaYann commented 11 months ago

Context:

Ovh api now send a 204 no content response when you call /domain/zone/{zoneName}/refresh endpoint.

Problem:

Api.php\decodeResponse method throw a error by default when it fail to decode json, and so when you pass empty string from no content reponse

Proposal:

ruturn empty array when response has code 204 or body length is 0

All tests are passing, hope this can be merged fast.

Thanks !

OctaYann commented 11 months ago

I'm referencing to this issue #140

deathiop commented 11 months ago

Hi there, Thank you for your contribution!

This ended up handled in #142 (returning null instead of [], with tests). Therefore, I'm closing this one.